Browse code

Fix timestamp handling in more filters after the change which set the timebase in the filter link.

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

Stefano Sabatini authored on 2010/11/03 04:42:08
Showing 3 changed files
... ...
@@ -99,7 +99,7 @@ static void end_frame(AVFilterLink *inlink)
99 99
     if (pblack >= blackframe->bamount)
100 100
         av_log(ctx, AV_LOG_INFO, "frame:%u pblack:%u pos:%"PRId64" pts:%"PRId64" t:%f\n",
101 101
                blackframe->frame, pblack, picref->pos, picref->pts,
102
-               picref->pts == AV_NOPTS_VALUE ? -1 : (double)picref->pts / AV_TIME_BASE);
102
+               picref->pts == AV_NOPTS_VALUE ? -1 : picref->pts * av_q2d(inlink->time_base));
103 103
 
104 104
     blackframe->frame++;
105 105
     blackframe->nblack = 0;
... ...
@@ -184,7 +184,7 @@ static void end_frame(AVFilterLink *inlink)
184 184
         av_log(ctx, AV_LOG_INFO,
185 185
                "x1:%d x2:%d y1:%d y2:%d w:%d h:%d x:%d y:%d pos:%"PRId64" pts:%"PRId64" t:%f crop=%d:%d:%d:%d\n",
186 186
                cd->x1, cd->x2, cd->y1, cd->y2, w, h, x, y, picref->pos, picref->pts,
187
-               picref->pts == AV_NOPTS_VALUE ? -1 : (double)picref->pts / AV_TIME_BASE,
187
+               picref->pts == AV_NOPTS_VALUE ? -1 : picref->pts * av_q2d(inlink->time_base),
188 188
                w, h, x, y);
189 189
     }
190 190
 
... ...
@@ -330,7 +330,7 @@ static void end_frame(AVFilterLink *inlink)
330 330
     AVFilterBufferRef  *inpicref =  inlink->cur_buf;
331 331
     AVFilterBufferRef *outpicref = outlink->out_buf;
332 332
 
333
-    frei0r->update(frei0r->instance, (double)inpicref->pts / AV_TIME_BASE,
333
+    frei0r->update(frei0r->instance, inpicref->pts * av_q2d(inlink->time_base) * 1000,
334 334
                    (const uint32_t *)inpicref->data[0],
335 335
                    (uint32_t *)outpicref->data[0]);
336 336
     avfilter_unref_buffer(inpicref);