From b48689cb87d8147753001325527bfc5b743ced32 Mon Sep 17 00:00:00 2001 From: Christophe Thommeret Date: Wed, 11 Feb 2009 23:42:57 +0000 Subject: vo_vdpau: try to get frame duration from previous img->pts when frame->duration is 0. --- src/video_out/video_out_vdpau.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/video_out/video_out_vdpau.c b/src/video_out/video_out_vdpau.c index 3831a0c2a..ff1c4893e 100644 --- a/src/video_out/video_out_vdpau.c +++ b/src/video_out/video_out_vdpau.c @@ -1328,8 +1328,14 @@ static void vdpau_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) layer[layer_count-1].struct_version = VDP_LAYER_VERSION; } + /* try to get frame duration from previous img->pts when frame->duration is 0 */ + int frame_duration = frame->vo_frame.duration; + if ( !frame_duration && this->back_frame[0] ) { + int duration = frame->vo_frame.pts - this->back_frame[0]->vo_frame.pts; + if ( duration>0 && duration<4000 ) + frame_duration = duration; + } int non_progressive = (this->honor_progressive && !frame->vo_frame.progressive_frame) || !this->honor_progressive; - int frame_duration = (frame->vo_frame.duration>0) ? frame->vo_frame.duration : 3000; /* unknown frame duration should not lead to no deint! */ if ( stream_speed && frame_duration>2500 && this->deinterlace && non_progressive && frame->format==XINE_IMGFMT_VDPAU ) { VdpTime current_time = 0; VdpVideoSurface past[2]; -- cgit v1.2.3