diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-06-15 00:09:39 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-06-15 00:14:21 +0200 |
commit | 15f8941108c5372862035ce8e3cbfd2a6cefb241 (patch) | |
tree | 921dc52f4b22ae8f66f251000ecf495154f41e88 /libavformat/rtmppkt.c | |
parent | 01a14ce0424a45caa24d4a9103afe26c39a6fd35 (diff) | |
parent | d246c18ea6dca4dbdc92aec6ae4e3e038999a709 (diff) | |
download | ffmpeg-15f8941108c5372862035ce8e3cbfd2a6cefb241.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
Avoid C99 variable declarations within for statements.
rtmp: Read and handle incoming packets while writing data
doc: document THREAD_TYPE fate variable
rtpdec: Don't require frames to start with a Mode A packet
avconv: don't try to free threads that were not initialized.
Conflicts:
doc/fate.texi
ffplay.c
libavdevice/dv1394.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtmppkt.c')
-rw-r--r-- | libavformat/rtmppkt.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/libavformat/rtmppkt.c b/libavformat/rtmppkt.c index f0efa59257..4b5f188074 100644 --- a/libavformat/rtmppkt.c +++ b/libavformat/rtmppkt.c @@ -74,15 +74,25 @@ void ff_amf_write_object_end(uint8_t **dst) int ff_rtmp_packet_read(URLContext *h, RTMPPacket *p, int chunk_size, RTMPPacket *prev_pkt) { - uint8_t hdr, t, buf[16]; + uint8_t hdr; + + if (ffurl_read(h, &hdr, 1) != 1) + return AVERROR(EIO); + + return ff_rtmp_packet_read_internal(h, p, chunk_size, prev_pkt, hdr); +} + +int ff_rtmp_packet_read_internal(URLContext *h, RTMPPacket *p, int chunk_size, + RTMPPacket *prev_pkt, uint8_t hdr) +{ + + uint8_t t, buf[16]; int channel_id, timestamp, data_size, offset = 0; uint32_t extra = 0; enum RTMPPacketType type; int size = 0; int ret; - if (ffurl_read(h, &hdr, 1) != 1) - return AVERROR(EIO); size++; channel_id = hdr & 0x3F; |