From: <rn...@gm...> - 2007-10-03 18:58:54
|
# HG changeset patch # User Reinhard Nißl <rn...@gm...> # Date 1191273898 -7200 # Node ID 94db7290a3f02e4fe297b8a770e12c925d30a0e3 # Parent 4e3ac9865bc4c3394fd204812b5c5c5be49353ae Set PTS even for bad frames to improve syncing of audio and video. When a stream doesn't start with an IDR frame, there will be several seconds of bad frames and not setting PTS on those frames causes an unnecessary delay in syncing audio and video. diff -r 94db7290a3f02e4fe297b8a770e12c925d30a0e3 -r 4e3ac9865bc4c3394fd204812b5c5c5be49353ae src/libffmpeg/ff_video_decoder.c --- a/src/libffmpeg/ff_video_decoder.c Mon Oct 01 23:24:58 2007 +0200 +++ b/src/libffmpeg/ff_video_decoder.c Mon Oct 01 23:21:23 2007 +0200 @@ -1301,7 +1301,10 @@ static void ff_handle_buffer (ff_video_d this->aspect_ratio, this->output_format, VO_BOTH_FIELDS|this->frame_flags); - img->pts = 0; + /* set PTS to allow early syncing */ + img->pts = this->pts; + this->pts = 0; + img->duration = this->video_step; img->bad_frame = 1; this->skipframes = img->draw(img, this->stream); |