MPEG seek crash (was: [Ffmpeg-devel] Re: Compiling FFmpeg using ISO/C89 compiler)

Michael Niedermayer michaelni
Sat Dec 9 19:36:49 CET 2006


Hi

On Sat, Dec 09, 2006 at 05:47:55PM +0100, Reimar D?ffinger wrote:
> Hello,
> On Sat, Dec 09, 2006 at 05:09:50PM +0100, Michael Niedermayer wrote:
> > On Sat, Dec 09, 2006 at 12:07:34PM +0100, Reimar D?ffinger wrote:
> > > On Fri, Dec 08, 2006 at 05:28:57PM +0100, Baptiste Coudurier wrote:
> > > > If my chems1.vob is the same one, and anyway it should not crash indeed.
> > > > I confirm that ffplay_g crash with current svn.
> > > > 
> > > > Log attached. Hope this helps.
> > > 
> > > Can you test attached patch? I guess it is a bit hackish, but I'd really
> > > like to know what kind of effect it has *g*
> > > 
> > > Greetings,
> > > Reimar D?ffinger
> > 
> > > Index: libavcodec/mpegvideo.c
> > > ===================================================================
> > > --- libavcodec/mpegvideo.c	(revision 7261)
> > > +++ libavcodec/mpegvideo.c	(working copy)
> > > @@ -3905,6 +3905,8 @@
> > >          return;
> > >      }
> > >  #endif
> > > +    if (!s->last_picture.data) s->mv_dir &= ~MV_DIR_FORWARD;
> > > +    if (!s->next_picture.data) s->mv_dir &= ~MV_DIR_BACKWARD;
> > >  
> > 
> > IMHO if either reference frame of a b frame is unavailable then either
> > A. drop it (easy and logic, and not terribly noticeable)
> > B. for every MB
> >     * if its bidir drop the vector for an unavailable frame
> >     * if its forward or backward and the reference is unavailable
> >       flip the motion vector (* -1 * difference in temporal distance)
> >     * if neither reference is available drop the b frame
> > C. some more complex temporal iterpolation based on available motion vectors
> > 
> > and my guess would be that B would look bad for most mpeg2 files as most
> > mpeg2 encoders are trash and select bad motion vectors ...
> 
> So just
> if (s->mv_dir & MV_DIR_FORWARD && !s->last_picture.data) return;
> if (s->mv_dir & MV_DIR_BACKWARD && !s->next_picture.data) return;
> 
> Instead of the above?

iam more thinking of
if(s->pict_type == B_TYPE){
    if(!s->last_picture.data || !s->next_picture.data)
        return -1;
}
after decoding the header, assumng we are on the right track at all ...


> Either way, I do not yet even know if either one helps at all *g*

neither do i ...

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you really think that XML is the answer, then you definitly missunderstood
the question -- Attila Kinali




More information about the ffmpeg-devel mailing list