summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/xine/video_out.h3
-rw-r--r--src/video_dec/libvdpau/vdpau_mpeg12.c3
-rw-r--r--src/video_out/video_out_vdpau.c23
3 files changed, 10 insertions, 19 deletions
diff --git a/include/xine/video_out.h b/include/xine/video_out.h
index 7f88ef504..dff1895af 100644
--- a/include/xine/video_out.h
+++ b/include/xine/video_out.h
@@ -283,6 +283,7 @@ struct xine_video_port_s {
#define VO_INTERLACED_FLAG 8
#define VO_NEW_SEQUENCE_FLAG 16 /* set after MPEG2 Sequence Header Code (used by XvMC) */
#define VO_CHROMA_422 32 /* used by VDPAU, default is chroma_420 */
+#define VO_STILL_IMAGE 64
/* video driver capabilities */
#define VO_CAP_YV12 0x00000001 /* driver can handle YUV 4:2:0 pictures */
@@ -294,7 +295,7 @@ struct xine_video_port_s {
#define VO_CAP_XXMC 0x00000040 /* driver can use extended XvMC */
#define VO_CAP_VDPAU_H264 0x00000080 /* driver can use VDPAU for H264 */
#define VO_CAP_VDPAU_MPEG12 0x00000100 /* driver can use VDPAU for mpeg1/2 */
-#define VO_CAP_VDPAU_VC1 0x00000200 /* driver can use VDPAU for mpeg1/2 */
+#define VO_CAP_VDPAU_VC1 0x00000200 /* driver can use VDPAU for VC1 */
#define VO_CAP_HUE 0x00010000
#define VO_CAP_SATURATION 0x00020000
#define VO_CAP_CONTRAST 0x00040000
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 );
}