summaryrefslogtreecommitdiff
path: root/libavformat/rtmppkt.c
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2009-10-18 07:01:06 +0000
committerKostya Shishkov <kostya.shishkov@gmail.com>2009-10-18 07:01:06 +0000
commit5d660598b0f1300182240074d4dbada41fe694d9 (patch)
treef22c9597f60d5fa6af13588962bde2b2737af44b /libavformat/rtmppkt.c
parent8f648b74c348e866e3d24b038258919341b87a9e (diff)
Support more than 64 channels in RTMP input
Originally committed as revision 20270 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rtmppkt.c')
-rw-r--r--libavformat/rtmppkt.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/rtmppkt.c b/libavformat/rtmppkt.c
index 4ca12a0041..f6e2a9024e 100644
--- a/libavformat/rtmppkt.c
+++ b/libavformat/rtmppkt.c
@@ -81,6 +81,12 @@ int ff_rtmp_packet_read(URLContext *h, RTMPPacket *p,
return AVERROR(EIO);
channel_id = hdr & 0x3F;
+ if (channel_id < 2) { //special case for channel number >= 64
+ buf[1] = 0;
+ if (url_read_complete(h, buf, channel_id + 1) != channel_id + 1)
+ return AVERROR(EIO);
+ channel_id = AV_RL16(buf) + 64;
+ }
data_size = prev_pkt[channel_id].data_size;
type = prev_pkt[channel_id].type;
extra = prev_pkt[channel_id].extra;