summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Thommeret <hftom@free.fr>2009-02-11 23:42:57 +0000
committerChristophe Thommeret <hftom@free.fr>2009-02-11 23:42:57 +0000
commitb48689cb87d8147753001325527bfc5b743ced32 (patch)
tree409998b80937443f43a592160899debd4b6f9818
parent5760073f495f7143b1a39e88e8dfa2a977acdf57 (diff)
downloadxine-lib-b48689cb87d8147753001325527bfc5b743ced32.tar.gz
xine-lib-b48689cb87d8147753001325527bfc5b743ced32.tar.bz2
vo_vdpau: try to get frame duration from previous img->pts when frame->duration is 0.
-rw-r--r--src/video_out/video_out_vdpau.c8
1 files changed, 7 insertions, 1 deletions
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];