[FFmpeg-devel] [PATCH] libavfilter-soc: make ffplay.c:request_input_frame() check for got_frame
Michael Niedermayer
michaelni
Mon Jan 5 19:48:23 CET 2009
On Sun, Dec 28, 2008 at 05:22:24PM +0100, Stefano Sabatini wrote:
> On date Thursday 2008-12-25 11:45:26 +0100, Stefano Sabatini encoded:
> > Hi,
> >
> > get_video_frame() returns 0 if it didn't get any frame, 1 otherwise,
> > and input_get_frame() is *requested* to get a frame, patch add a
> > check for this.
> >
> > Problem discovered when playing MPlayer sample
> > MPEG2/res_change_ffmpeg_aspect.ts.
> >
> > I'm not sure this is the better way to do it from the intrface point of
> > view, maybe a get_video_frame() like this:
> >
> > static int get_video_frame(VideoState *is, AVFrame *frame, uint64_t *pts, AVPacket *pkt, int *got_frame)
> >
> > would be nicer/more consistent with the rest of libav*, opinions?
> >
> > Regards.
> > --
> > FFmpeg = Free and Furious Mysterious Problematic Elastic Gadget
>
> > Index: libavfilter-soc/ffmpeg/ffplay.c
> > ===================================================================
> > --- libavfilter-soc.orig/ffmpeg/ffplay.c 2008-12-25 11:35:57.000000000 +0100
> > +++ libavfilter-soc/ffmpeg/ffplay.c 2008-12-25 11:36:57.000000000 +0100
> > @@ -1472,9 +1472,11 @@
> > AVFilterPicRef *picref;
> > uint64_t pts = 0;
> > AVPacket pkt;
> > + int res = 0;
> >
> > - if(get_video_frame(priv->is, priv->frame, &pts, &pkt) < 0)
> > - return -1;
> > + while ((res = get_video_frame(priv->is, priv->frame, &pts, &pkt)) <= 0)
> > + if (res < 0)
> > + return -1;
> >
> > /* FIXME: until I figure out how to hook everything up to the codec
> > * right, we're just copying the entire frame. */
>
> And in attachment another possibility, for which I have a slight
> preference, please say which you prefer if any is acceptable.
this probably is ok
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090105/5db12f7b/attachment.pgp>
More information about the ffmpeg-devel
mailing list