[FFmpeg-devel] [PATCH] libavfilter-soc: make ffplay.c:request_input_frame() check for got_frame

Stefano Sabatini stefano.sabatini-lala
Sun Jan 11 20:04:20 CET 2009


On date Sunday 2009-01-11 19:18:46 +0100, Michael Niedermayer encoded:
> On Sun, Jan 11, 2009 at 07:10:33PM +0100, Stefano Sabatini wrote:
> > On date Sunday 2009-01-11 18:20:21 +0100, Michael Niedermayer encoded:
> > > On Sun, Jan 11, 2009 at 05:29:19PM +0100, Stefano Sabatini wrote:
> > > > On date Sunday 2009-01-11 15:20:29 +0100, Michael Niedermayer encoded:
> > [...]
> > > > Index: libavfilter-soc/ffmpeg/ffplay.c
> > > > ===================================================================
> > > > --- libavfilter-soc.orig/ffmpeg/ffplay.c	2009-01-11 17:16:17.000000000 +0100
> > > > +++ libavfilter-soc/ffmpeg/ffplay.c	2009-01-11 17:19:53.000000000 +0100
> > > > @@ -1473,15 +1473,16 @@
> > > >      AVPacket pkt;
> > > >      int got_picture = 0;
> > > >  
> > > > +    do {
> > > >      if(get_video_frame(priv->is, priv->frame, &pts, &pkt, &got_picture) < 0)
> > > >          return -1;
> > > >  
> > > > +    if (got_picture) {
> > > >      /* FIXME: until I figure out how to hook everything up to the codec
> > > >       * right, we're just copying the entire frame. */
> > > >      picref = avfilter_get_video_buffer(link, AV_PERM_WRITE);
> > > >      av_picture_copy((AVPicture *)&picref->data, (AVPicture *)priv->frame,
> > > >                      picref->pic->format, picref->w, picref->h);
> > > > -    av_free_packet(&pkt);
> > > >  
> > > >      picref->pts = pts;
> > > >      picref->pixel_aspect = priv->is->video_st->codec->sample_aspect_ratio;
> > > > @@ -1489,6 +1490,10 @@
> > > >      avfilter_draw_slice(link, 0, picref->h);
> > > >      avfilter_end_frame(link);
> > > >      avfilter_unref_pic(picref);
> > > > +    }
> > > > +
> > > > +    av_free_packet(&pkt);
> > > > +    } while(!got_picture);
> > > >  
> > > >      return 0;
> > > >  }
> > > 
> > > while(!(ret= get_video_frame(priv->is, priv->frame, &pts, &pkt)))
> > >     av_free_packet(&pkt);
> > 
> > ...
> 
> ok

Applied.
-- 
FFmpeg = Fundamental and Frightening Mythic Peaceless Elastic Gymnast




More information about the ffmpeg-devel mailing list