Mercurial > libavformat.hg
changeset 5401:432e1b6e1568 libavformat
Write header for RTMP packets with channel_id >= 64 correctly
author | kostya |
---|---|
date | Tue, 01 Dec 2009 15:13:23 +0000 |
parents | c7d1e90d4935 |
children | 99aeb2e385df |
files | rtmppkt.c |
diffstat | 1 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/rtmppkt.c Tue Dec 01 15:07:32 2009 +0000 +++ b/rtmppkt.c Tue Dec 01 15:13:23 2009 +0000 @@ -151,7 +151,15 @@ int off = 0; //TODO: header compression - bytestream_put_byte(&p, pkt->channel_id | (mode << 6)); + if (pkt->channel_id < 64) { + bytestream_put_byte(&p, pkt->channel_id | (mode << 6)); + } else if (pkt->channel_id < 64 + 256) { + bytestream_put_byte(&p, 0 | (mode << 6)); + bytestream_put_byte(&p, pkt->channel_id - 64); + } else { + bytestream_put_byte(&p, 1 | (mode << 6)); + bytestream_put_le16(&p, pkt->channel_id - 64); + } if (mode != RTMP_PS_ONEBYTE) { bytestream_put_be24(&p, pkt->timestamp >= 0xFFFFFF ? 0xFFFFFF : pkt->timestamp); if (mode != RTMP_PS_FOURBYTES) {