Commit 7802a4cc authored by rtogni's avatar rtogni

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



git-svn-id: file:///var/local/repositories/ffmpeg/trunk@11129 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent dd505d6a
...@@ -349,7 +349,7 @@ static int rm_write_video(AVFormatContext *s, const uint8_t *buf, int size, int ...@@ -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 /* Well, I spent some time finding the meaning of these bits. I am
not sure I understood everything, but it works !! */ not sure I understood everything, but it works !! */
#if 1 #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 */ /* bit 7: '1' if final packet of a frame converted in several packets */
put_byte(pb, 0x81); put_byte(pb, 0x81);
/* bit 7: '1' if I frame. bits 6..0 : sequence number in current /* 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 ...@@ -359,8 +359,13 @@ static int rm_write_video(AVFormatContext *s, const uint8_t *buf, int size, int
} else { } else {
put_byte(pb, 0x01); put_byte(pb, 0x01);
} }
put_be16(pb, 0x4000 + (size)); /* total frame size */ if(size >= 0x4000){
put_be16(pb, 0x4000 + (size)); /* offset from the start or the end */ 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 #else
/* full frame */ /* full frame */
write_packet_header(s, size + 6); write_packet_header(s, size + 6);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment