Browse code

Fix timestamp scaling in the overlay filter.

Compute the outpicref PTS in start_frame(), since it is required for
comparing that value with the value of the overpicref.

Originally committed as revision 25828 to svn://svn.ffmpeg.org/ffmpeg/trunk

Stefano Sabatini authored on 2010/11/26 06:22:55
Showing 1 changed files
... ...
@@ -212,6 +212,8 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
212 212
     OverlayContext *over = ctx->priv;
213 213
 
214 214
     inlink->dst->outputs[0]->out_buf = outpicref;
215
+    outpicref->pts = av_rescale_q(outpicref->pts, ctx->inputs[MAIN]->time_base,
216
+                                  ctx->outputs[0]->time_base);
215 217
 
216 218
     if (!over->overpicref || over->overpicref->pts < outpicref->pts) {
217 219
         AVFilterBufferRef *old = over->overpicref;
... ...
@@ -322,9 +324,6 @@ static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
322 322
     AVFilterBufferRef *outpicref = outlink->out_buf;
323 323
     OverlayContext *over = ctx->priv;
324 324
 
325
-    outpicref->pts = av_rescale_q(outpicref->pts, ctx->inputs[MAIN]->time_base,
326
-                                  outlink->time_base);
327
-
328 325
     if (over->overpicref &&
329 326
         !(over->x >= outpicref->video->w || over->y >= outpicref->video->h ||
330 327
           y+h < over->y || y >= over->y + over->overpicref->video->h)) {