[MPlayer-dev-eng] [RFC] h264 ES parser problems

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Fri Sep 16 00:48:39 CEST 2005


Hi,
On Thu, Sep 15, 2005 at 05:24:58PM +0200, Reimar Döffinger wrote:
> this file does not play right unless you use -demuxer lavf:
> http://stud4.tuwien.ac.at/~e0326863/ats/bbc-sample_small.mpg
> I mostly tracked down the place of the bug, but I don't know the right
> fix.
> The attached patch makes this file play, but might break lots of others.
> If you know the right fix, please send a patch (or fix right away).

A better fix. According to section 7.4.1.2.3 of the H264 specs, the NAL
numbers 6-9 and 14-18 specify a start of a frame. The patch implements
that.
But it does not check for "first VCL NAL unit of primary ocdec picture",
this seems rather complicated to me...
If you have any H264 samples in MPEG container, please test them.

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: libmpdemux/video.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/video.c,v
retrieving revision 1.53
diff -u -r1.53 video.c
--- libmpdemux/video.c	26 Aug 2005 22:53:59 -0000	1.53
+++ libmpdemux/video.c	15 Sep 2005 22:03:48 -0000
@@ -532,7 +533,7 @@
             if(!i) return -1;
             if(!read_video_packet(d_video)) return -1; // EOF
           }
-          if((i&~0x60) == 0x101 || (i&~0x60) == 0x102 || (i&~0x60) == 0x105) break;
+          if ((i >= 0x106 && i <= 0x109) || (i >= 0x10e && i <= 0x112)) break;
         }
 	*start=videobuffer; in_size=videobuf_len;
 	videobuf_len=0;


More information about the MPlayer-dev-eng mailing list