[FFmpeg-devel] [PATCH 2/4] Change the PTS time base to AV_TIME_BASE before to process a frame in the filter chain, and change it back to the stream time base in the filtered frame.

Stefano Sabatini stefano.sabatini-lala
Sat Jun 12 00:45:29 CEST 2010


On date Wednesday 2010-06-09 00:17:27 +0200, Stefano Sabatini encoded:
> This is required, since all the frames in the filterchain are supposed
> to use a time base of AV_TIME_BASE.
> ---
>  ffplay.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/ffplay.c b/ffplay.c
> index 129cd28..dd3cba0 100644
> --- a/ffplay.c
> +++ b/ffplay.c
> @@ -1678,7 +1678,7 @@ static int input_request_frame(AVFilterLink *link)
>      }
>      av_free_packet(&pkt);
>  
> -    picref->pts = pts;
> +    picref->pts = av_rescale_q(pkt.pts, priv->is->video_st->time_base, AV_TIME_BASE_Q);
>      picref->pos = pkt.pos;
>      picref->pixel_aspect = priv->is->video_st->codec->sample_aspect_ratio;
>      avfilter_start_frame(link, picref);
> @@ -1838,6 +1838,7 @@ static int video_thread(void *arg)
>              SDL_Delay(10);
>  #if CONFIG_AVFILTER
>          ret = get_filtered_video_frame(filt_out, frame, &pts_int, &pos);
> +        pts_int = av_rescale_q(pts_int, AV_TIME_BASE_Q, is->video_st->time_base);
>  #else
>          ret = get_video_frame(is, frame, &pts_int, &pkt);
>  #endif

Ping? (That's required by the setpts patch).

Regards.
-- 
FFmpeg = Fast Fast Multimedia Practical Enchanting Gangster



More information about the ffmpeg-devel mailing list