[MPlayer-dev-eng] [PATCH] dvdnav part 3 - emptyframe

elupus elupus at ecce.se
Tue Jul 31 01:45:05 CEST 2007


"Ötvös Attila" <oattila at chello.hu> wrote in message 
news:200707301835.29057.oattila at chello.hu...
>
> I know. :(
>
> Since I work the dvdnav ever since I try to persuade the libmpeg2 to
> decode still frame always.
> I should be very glad if somebody should know a better solution.
> I asked for help several times and this was born in my despond...
>
> Best regards.
> Attila

The issue isn't with libmpeg2 asfar as I see it. I haven't checked mplayer's 
demuxer, but lavf has had the issues for a long time. I have reported about 
it as have a few others.
If the stream doesn't go eof, lavf always search for the start of next image 
to signify the end of the current one. Since the last thing the mpeg stream 
contains in the case of stills is eof sequence, the parser never outputs 
this to the decoder, it get's stuck in the demuxer.

This is the hack we've had in lavf for a few years now to solve the issue 
with stills, and has yet to cause any issues. I think there where a much 
cleaner patch submited a while back, but can't remember when that was.

Joakim

Ps. yea i know you prefer patches attached as files, but this was simpler 
and is nothing that will get applied anyways.

Index: mpeg12.c
===================================================================
--- mpeg12.c (revision 9451)
+++ mpeg12.c (working copy)
@@ -3047,6 +3047,19 @@
         }
     }

+    /* look for SEQ_END_CODE at the last data in this buffer*/
+    /* dvd's won't send the next frame start on still images*/
+    /* state should hold the last startcode if one was found above*/
+    /* i will point to the position after that startcode */
+    if(!pc->frame_start_found){
+        if(state == SEQ_END_CODE){
+            pc->state=-1;
+            return i;
+        }
+    }
+
     if(pc->frame_start_found){
         /* EOF considered as end of frame */
         if (buf_size == 0)







More information about the MPlayer-dev-eng mailing list