diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-09-17 11:39:41 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-17 11:39:45 +0200 |
commit | a275ff7e010a7fd5899014353996ef3154f3341d (patch) | |
tree | 56db3e0cff77717b9dbe6a540a77584b2302858b | |
parent | 9589b6190494e91517e4a54bb7a565ecdf05bda8 (diff) | |
parent | 92ed83e393d25b6d15920e90d56ee77de54a9728 (diff) | |
download | ffmpeg-a275ff7e010a7fd5899014353996ef3154f3341d.tar.gz |
Merge commit '92ed83e393d25b6d15920e90d56ee77de54a9728'
* commit '92ed83e393d25b6d15920e90d56ee77de54a9728':
rtmp: Store all the notify messages
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/rtmpproto.c | 59 |
1 files changed, 29 insertions, 30 deletions
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index 01e92854a3..e996035320 100644 --- a/libavformat/rtmpproto.c +++ b/libavformat/rtmpproto.c @@ -2085,39 +2085,38 @@ static int handle_notify(URLContext *s, RTMPPacket *pkt) { if (ff_amf_read_string(&gbc, statusmsg, sizeof(statusmsg), &stringlen)) return AVERROR_INVALIDDATA; - if (strcmp(statusmsg, "onMetaData")) { - av_log(s, AV_LOG_INFO, "Expecting onMetadata but got %s\n", - statusmsg); - return 0; - } - - /* Provide ECMAArray to flv */ - ts = pkt->timestamp; + } else { + datatowrite = pkt->data; + datatowritelength = pkt->size; + } - // generate packet header and put data into buffer for FLV demuxer - if (rt->flv_off < rt->flv_size) { - old_flv_size = rt->flv_size; - rt->flv_size += datatowritelength + 15; - } else { - old_flv_size = 0; - rt->flv_size = datatowritelength + 15; - rt->flv_off = 0; - } + /* Provide ECMAArray to flv */ + ts = pkt->timestamp; - cp = av_realloc(rt->flv_data, rt->flv_size); - if (!cp) - return AVERROR(ENOMEM); - rt->flv_data = cp; - bytestream2_init_writer(&pbc, cp, rt->flv_size); - bytestream2_skip_p(&pbc, old_flv_size); - bytestream2_put_byte(&pbc, pkt->type); - bytestream2_put_be24(&pbc, datatowritelength); - bytestream2_put_be24(&pbc, ts); - bytestream2_put_byte(&pbc, ts >> 24); - bytestream2_put_be24(&pbc, 0); - bytestream2_put_buffer(&pbc, datatowrite, datatowritelength); - bytestream2_put_be32(&pbc, 0); + // generate packet header and put data into buffer for FLV demuxer + if (rt->flv_off < rt->flv_size) { + old_flv_size = rt->flv_size; + rt->flv_size += datatowritelength + 15; + } else { + old_flv_size = 0; + rt->flv_size = datatowritelength + 15; + rt->flv_off = 0; } + + cp = av_realloc(rt->flv_data, rt->flv_size); + if (!cp) + return AVERROR(ENOMEM); + rt->flv_data = cp; + bytestream2_init_writer(&pbc, cp, rt->flv_size); + bytestream2_skip_p(&pbc, old_flv_size); + bytestream2_put_byte(&pbc, pkt->type); + bytestream2_put_be24(&pbc, datatowritelength); + bytestream2_put_be24(&pbc, ts); + bytestream2_put_byte(&pbc, ts >> 24); + bytestream2_put_be24(&pbc, 0); + bytestream2_put_buffer(&pbc, datatowrite, datatowritelength); + bytestream2_put_be32(&pbc, 0); + return 0; } |