]> git.sesse.net Git - ffmpeg/commitdiff
Fix crop->var_values[VAR_T] computation in the crop filter.
authorStefano Sabatini <stefano.sabatini-lala@poste.it>
Tue, 2 Nov 2010 18:40:55 +0000 (18:40 +0000)
committerStefano Sabatini <stefano.sabatini-lala@poste.it>
Tue, 2 Nov 2010 18:40:55 +0000 (18:40 +0000)
Originally committed as revision 25645 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavfilter/vf_crop.c

index c72ed2c9e4d0ea435a5132ab2175197907f614e3..1a920823967bb9ebb112f9c18f2020c5154996f2 100644 (file)
@@ -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 : picref->pts * av_q2d(link->time_base);
     crop->var_values[VAR_POS] = picref->pos == -1 ? NAN : picref->pos;
     crop->var_values[VAR_X] = av_eval_expr(crop->x_pexpr, crop->var_values, NULL);
     crop->var_values[VAR_Y] = av_eval_expr(crop->y_pexpr, crop->var_values, NULL);