diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2007-12-02 17:51:05 +0000 |
---|---|---|
committer | Roberto Togni <r_togni@tiscali.it> | 2007-12-02 17:51:05 +0000 |
commit | 47ac2b0d143ecd869e99271cf9c67acf9f76de43 (patch) | |
tree | b10b356eb6ab59cb8497175fd00ca3e713d2525a /libavformat/rmenc.c | |
parent | ec28509fed12956ab598161727f6ad498f0c27f8 (diff) | |
download | ffmpeg-47ac2b0d143ecd869e99271cf9c67acf9f76de43.tar.gz |
Fix muxer so that generated files are playable by realplayer, other open
source players and by fixed ffmpeg rm demuxer (after r11127)
Patch by kostya
Originally committed as revision 11129 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rmenc.c')
-rw-r--r-- | libavformat/rmenc.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libavformat/rmenc.c b/libavformat/rmenc.c index 57a4e757de..3a3525d969 100644 --- a/libavformat/rmenc.c +++ b/libavformat/rmenc.c @@ -349,7 +349,7 @@ static int rm_write_video(AVFormatContext *s, const uint8_t *buf, int size, int /* Well, I spent some time finding the meaning of these bits. I am not sure I understood everything, but it works !! */ #if 1 - write_packet_header(s, stream, size + 7, key_frame); + write_packet_header(s, stream, size + 7 + (size >= 0x4000)*4, key_frame); /* bit 7: '1' if final packet of a frame converted in several packets */ put_byte(pb, 0x81); /* bit 7: '1' if I frame. bits 6..0 : sequence number in current @@ -359,8 +359,13 @@ static int rm_write_video(AVFormatContext *s, const uint8_t *buf, int size, int } else { put_byte(pb, 0x01); } - put_be16(pb, 0x4000 + (size)); /* total frame size */ - put_be16(pb, 0x4000 + (size)); /* offset from the start or the end */ + if(size >= 0x4000){ + put_be32(pb, size); /* total frame size */ + put_be32(pb, size); /* offset from the start or the end */ + }else{ + put_be16(pb, 0x4000 | size); /* total frame size */ + put_be16(pb, 0x4000 | size); /* offset from the start or the end */ + } #else /* full frame */ write_packet_header(s, size + 6); |