diff options
author | Christophe Thommeret <hftom@free.fr> | 2010-01-14 19:18:02 +0100 |
---|---|---|
committer | Christophe Thommeret <hftom@free.fr> | 2010-01-14 19:18:02 +0100 |
commit | f881de2a9c9fab8c1f938fecbc1a8279e33dc729 (patch) | |
tree | 1eab5de7695dd241f78b000589d6712c6e30de38 /src | |
parent | 11e5e873e50542d9d0106b3e5e33023861db23a0 (diff) | |
download | xine-lib-f881de2a9c9fab8c1f938fecbc1a8279e33dc729.tar.gz xine-lib-f881de2a9c9fab8c1f938fecbc1a8279e33dc729.tar.bz2 |
Don't deinterlace still frames
still frames are marked by the decoder and the video_out will not deinterlace if the flag is set.
Diffstat (limited to 'src')
-rw-r--r-- | src/video_dec/libvdpau/vdpau_mpeg12.c | 3 | ||||
-rw-r--r-- | src/video_out/video_out_vdpau.c | 23 |
2 files changed, 8 insertions, 18 deletions
diff --git a/src/video_dec/libvdpau/vdpau_mpeg12.c b/src/video_dec/libvdpau/vdpau_mpeg12.c index a44f84cdd..a990c9852 100644 --- a/src/video_dec/libvdpau/vdpau_mpeg12.c +++ b/src/video_dec/libvdpau/vdpau_mpeg12.c @@ -702,8 +702,9 @@ static void decode_picture( vdpau_mpeg12_decoder_t *vd, uint8_t end_of_sequence return; } + int still_image = (end_of_sequence) ? VO_STILL_IMAGE : 0; vo_frame_t *img = vd->stream->video_out->get_frame( vd->stream->video_out, seq->coded_width, seq->coded_height, - seq->ratio, XINE_IMGFMT_VDPAU, VO_BOTH_FIELDS|seq->chroma|seq->reset ); + seq->ratio, XINE_IMGFMT_VDPAU, VO_BOTH_FIELDS | seq->chroma | seq->reset | still_image ); seq->reset = 0; vdpau_accel_t *accel = (vdpau_accel_t*)img->accel_data; if ( !seq->accel_vdpau ) diff --git a/src/video_out/video_out_vdpau.c b/src/video_out/video_out_vdpau.c index 86eaa168e..1c0ed61a8 100644 --- a/src/video_out/video_out_vdpau.c +++ b/src/video_out/video_out_vdpau.c @@ -1656,15 +1656,7 @@ static void vdpau_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) vid_dest.x0 = this->sc.output_xoffset; vid_dest.y0 = this->sc.output_yoffset; vid_dest.x1 = this->sc.output_xoffset+this->sc.output_width; vid_dest.y1 = this->sc.output_yoffset+this->sc.output_height; - /* prepare field delay calculation to not run into a deadlock while display locked */ stream_speed = frame->vo_frame.stream ? xine_get_param(frame->vo_frame.stream, XINE_PARAM_FINE_SPEED) : 0; - if (stream_speed != 0) { - int vo_bufs_in_fifo = 0; - _x_query_buffer_usage(frame->vo_frame.stream, NULL, NULL, &vo_bufs_in_fifo, NULL); - /* fprintf(stderr, "vo_bufs: %d\n", vo_bufs_in_fifo); */ - if (vo_bufs_in_fifo <= 0) - stream_speed = 0; /* still image -> no delay */ - } VdpTime last_time; @@ -1716,7 +1708,7 @@ static void vdpau_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) XLockDisplay( this->display ); #endif - if ( frame->format==XINE_IMGFMT_VDPAU && this->deinterlace && non_progressive /*&& stream_speed*/ && frame_duration>2500 ) { + if ( frame->format==XINE_IMGFMT_VDPAU && this->deinterlace && non_progressive && !(frame->vo_frame.flags & VO_STILL_IMAGE) && frame_duration>2500 ) { VdpTime current_time = 0; VdpVideoSurface past[2]; VdpVideoSurface future[1]; @@ -1761,19 +1753,16 @@ static void vdpau_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) if ( st != VDP_STATUS_OK ) printf( "vo_vdpau: vdp_video_mixer_render error : %s\n", vdp_get_error_string( st ) ); - /* calculate delay for second field: there should be no delay for still images otherwise, take replay speed into account */ - if (stream_speed > 0) + if ( stream_speed > 0 ) current_time += frame->vo_frame.duration * 1000000ull * XINE_FINE_SPEED_NORMAL / (180 * stream_speed); - else - current_time = 0; /* immediately i. e. no delay */ - //current_time = 0; - //printf( "vo_vdpau: deint delay = %d\n", frame_duration *1ull * XINE_FINE_SPEED_NORMAL / (180 * stream_speed) ); vdp_queue_display( vdp_queue, this->output_surface[this->current_output_surface], 0, 0, current_time ); vdpau_shift_queue( this_gen ); } } else { + if ( frame->vo_frame.flags & VO_STILL_IMAGE ) + printf("vo_vdpau: VO_STILL_IMAGE\n"); st = vdp_video_mixer_render( this->video_mixer, VDP_INVALID_HANDLE, 0, VDP_VIDEO_MIXER_PICTURE_STRUCTURE_FRAME, 0, 0, surface, 0, 0, &vid_source, this->output_surface[this->current_output_surface], &out_dest, &vid_dest, layer_count, layer_count?layer:NULL ); if ( st != VDP_STATUS_OK ) @@ -1787,9 +1776,9 @@ static void vdpau_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) XUnlockDisplay( this->display ); #endif - if ( stream_speed ) /* do not release past frame if paused, it will be used for redrawing */ + if ( stream_speed ) vdpau_backup_frame( this_gen, frame_gen ); - else + else /* do not release past frame if paused, it will be used for redrawing */ frame->vo_frame.free( &frame->vo_frame ); } |