[FFmpeg-devel] [PATCH 1/5] Fix crop->var_values[VAR_T] computation in the crop filter.

Stefano Sabatini stefano.sabatini-lala
Tue Nov 2 19:51:41 CET 2010


On date Monday 2010-11-01 12:57:20 +0100, Michael Niedermayer encoded:
> On Mon, Nov 01, 2010 at 11:37:54AM +0100, Stefano Sabatini wrote:
> > ---
> >  libavfilter/vf_crop.c |    4 ++--
> >  1 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/libavfilter/vf_crop.c b/libavfilter/vf_crop.c
> > index c72ed2c..b455850 100644
> > --- a/libavfilter/vf_crop.c
> > +++ b/libavfilter/vf_crop.c
> > @@ -240,8 +240,8 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
> >      picref->video->w = crop->w;
> >      picref->video->h = crop->h;
> >  
> > -    /* FIXME: when the TB will be settable */
> > -    crop->var_values[VAR_T]   = picref->pts == AV_NOPTS_VALUE ? NAN : (double)picref->pts / AV_TIME_BASE;
> > +    crop->var_values[VAR_T]   = picref->pts == AV_NOPTS_VALUE ? NAN :
> > +        (double)picref->pts * link->time_base.num / link->time_base.den;
> 
> i would have used av_q2d() but this is fine too if you prefer

Applied your variant.
-- 
FFmpeg = Faithful and Fantastic Most Practical Ecstatic Gorilla



More information about the ffmpeg-devel mailing list