summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinhard Nißl <rnissl@gmx.de>2007-10-01 23:24:58 +0200
committerReinhard Nißl <rnissl@gmx.de>2007-10-01 23:24:58 +0200
commit0c5696d523a43a5161134c354d6bfb21bb29bae6 (patch)
treee512d4e0bbb30b89543a8956e4800bdfd45e6ba9
parenta14c025e6e7bec4b731366a1703f18604d6c70ac (diff)
downloadxine-lib-0c5696d523a43a5161134c354d6bfb21bb29bae6.tar.gz
xine-lib-0c5696d523a43a5161134c354d6bfb21bb29bae6.tar.bz2
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.
-rw-r--r--src/libffmpeg/ff_video_decoder.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libffmpeg/ff_video_decoder.c b/src/libffmpeg/ff_video_decoder.c
index ccce9c578..077ff2fad 100644
--- a/src/libffmpeg/ff_video_decoder.c
+++ b/src/libffmpeg/ff_video_decoder.c
@@ -1301,7 +1301,10 @@ static void ff_handle_buffer (ff_video_decoder_t *this, buf_element_t *buf) {
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);