1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Refine srs-librtmp API, change print to format

This commit is contained in:
winlin 2017-03-01 10:52:57 +08:00
parent ad87bd7cf2
commit 72c4ae4a8c
8 changed files with 95 additions and 59 deletions

View file

@ -135,6 +135,7 @@ int do_proxy(srs_flv_t flv, srs_rtmp_t ortmp, int64_t re, int32_t* pstarttime, u
char* data = NULL;
srs_human_trace("start ingest flv to RTMP stream");
char buffer[1024];
for (;;) {
// tag header
if ((ret = srs_flv_read_tag_header(flv, &type, &size, ptimestamp)) != 0) {
@ -159,10 +160,11 @@ int do_proxy(srs_flv_t flv, srs_rtmp_t ortmp, int64_t re, int32_t* pstarttime, u
uint32_t timestamp = *ptimestamp;
if ((ret = srs_human_print_rtmp_packet(type, timestamp, data, size)) != 0) {
if ((ret = srs_human_format_rtmp_packet(buffer, sizeof(buffer), type, timestamp, data, size)) != 0) {
srs_human_trace("print packet failed. ret=%d", ret);
return ret;
}
srs_human_trace("%s", buffer);
if ((ret = srs_rtmp_write_packet(ortmp, type, *ptimestamp, data, size)) != 0) {
srs_human_trace("irtmp get packet failed. ret=%d", ret);