[FFmpeg-devel] [PATCH] Make RM demuxer demux more frames

Kostya kostya.shishkov
Tue Sep 4 11:38:58 CEST 2007

Attached patch fixes another braindamaged feature of RM container
not handled by lavf - multiple frames in one packet.
Actually, packet with the last slice of frame has real
subpacket length stored in 'pos' and the rest of packet
may be occupied by slices for the next frames (current demuxer
ignores that fact).
-------------- next part --------------
Index: libavformat/rmdec.c
--- libavformat/rmdec.c	(revision 10288)
+++ libavformat/rmdec.c	(working copy)
@@ -510,6 +510,8 @@
             rm->current_stream= st->id;
 //            av_log(NULL, AV_LOG_DEBUG, "%X len:%d pos:%d len2:%d pic_num:%d\n",h, len, pos, len2, pic_num);
+            if((h & 0xc0) == 0x80)
+                len=pos;
             if(len2 && len2<len)
             rm->remaining_len-= len;

More information about the ffmpeg-devel mailing list