diff options
author | Christophe Thommeret <hftom@free.fr> | 2010-01-13 20:49:24 +0100 |
---|---|---|
committer | Christophe Thommeret <hftom@free.fr> | 2010-01-13 20:49:24 +0100 |
commit | 11e5e873e50542d9d0106b3e5e33023861db23a0 (patch) | |
tree | 90727f4e62124485bb534c28265003c20fbfa377 /src/video_dec | |
parent | d431fcea12f5ea22f9db41b7a70ba7eaf03521e5 (diff) | |
download | xine-lib-11e5e873e50542d9d0106b3e5e33023861db23a0.tar.gz xine-lib-11e5e873e50542d9d0106b3e5e33023861db23a0.tar.bz2 |
Clear VDPAU surfaces on new streams.
Diffstat (limited to 'src/video_dec')
-rw-r--r-- | src/video_dec/libvdpau/vdpau_h264.c | 13 | ||||
-rw-r--r-- | src/video_dec/libvdpau/vdpau_mpeg12.c | 20 |
2 files changed, 24 insertions, 9 deletions
diff --git a/src/video_dec/libvdpau/vdpau_h264.c b/src/video_dec/libvdpau/vdpau_h264.c index c9ef68ebf..2a6ef564c 100644 --- a/src/video_dec/libvdpau/vdpau_h264.c +++ b/src/video_dec/libvdpau/vdpau_h264.c @@ -1,6 +1,8 @@ /* * Copyright (C) 2008 Julian Scheel * + * kate: space-indent on; indent-width 2; mixedindent off; indent-mode cstyle; remove-trailing-space on; + * * This file is part of xine, a free video player. * * xine is free software; you can redistribute it and/or modify @@ -85,6 +87,8 @@ typedef struct vdpau_h264_decoder_s { int vdp_runtime_nr; + int reset; + } vdpau_h264_decoder_t; static void vdpau_h264_reset (video_decoder_t *this_gen); @@ -349,7 +353,8 @@ static int vdpau_decoder_init(video_decoder_t *this_gen) img = this->stream->video_out->get_frame (this->stream->video_out, this->width, this->height, this->ratio, - XINE_IMGFMT_VDPAU, VO_BOTH_FIELDS); + XINE_IMGFMT_VDPAU, VO_BOTH_FIELDS | this->reset); + this->reset = 0; img->duration = this->video_step; img->pts = this->completed_pic->pts; @@ -688,6 +693,7 @@ static void vdpau_h264_flush (video_decoder_t *this_gen) { dpb_set_output_picture(&(this->nal_parser->dpb), decoded_pic); } dpb_free_all(&this->nal_parser->dpb); + this->reset = VO_NEW_SEQUENCE_FLAG; } /* @@ -726,6 +732,8 @@ static void vdpau_h264_reset (video_decoder_t *this_gen) { } this->last_img = NULL; + + this->reset = VO_NEW_SEQUENCE_FLAG; } /* @@ -735,6 +743,7 @@ static void vdpau_h264_discontinuity (video_decoder_t *this_gen) { vdpau_h264_decoder_t *this = (vdpau_h264_decoder_t *) this_gen; dpb_clear_all_pts(&this->nal_parser->dpb); + this->reset = VO_NEW_SEQUENCE_FLAG; } /* @@ -804,6 +813,8 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre this->vdp_runtime_nr = runtime_nr; this->color_standard = VDP_COLOR_STANDARD_ITUR_BT_601; + this->reset = VO_NEW_SEQUENCE_FLAG; + this->nal_parser = init_parser(); (this->stream->video_out->open) (this->stream->video_out, this->stream); diff --git a/src/video_dec/libvdpau/vdpau_mpeg12.c b/src/video_dec/libvdpau/vdpau_mpeg12.c index 1b53b9cbe..a44f84cdd 100644 --- a/src/video_dec/libvdpau/vdpau_mpeg12.c +++ b/src/video_dec/libvdpau/vdpau_mpeg12.c @@ -152,6 +152,7 @@ typedef struct { bits_reader_t br; int vdp_runtime_nr; + int reset; } sequence_t; @@ -231,6 +232,7 @@ static void reset_sequence( sequence_t *sequence, int free_refs ) sequence->backward_ref->free( sequence->backward_ref ); sequence->backward_ref = NULL; sequence->top_field_first = 0; + sequence->reset = VO_NEW_SEQUENCE_FLAG; } @@ -701,7 +703,8 @@ static void decode_picture( vdpau_mpeg12_decoder_t *vd, uint8_t end_of_sequence } 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->ratio, XINE_IMGFMT_VDPAU, VO_BOTH_FIELDS|seq->chroma|seq->reset ); + seq->reset = 0; vdpau_accel_t *accel = (vdpau_accel_t*)img->accel_data; if ( !seq->accel_vdpau ) seq->accel_vdpau = accel; @@ -721,16 +724,16 @@ static void decode_picture( vdpau_mpeg12_decoder_t *vd, uint8_t end_of_sequence #ifdef MAKE_DAT if ( nframes==0 ) { - fwrite( &seq->coded_width, 1, sizeof(seq->coded_width), outfile ); - fwrite( &seq->coded_height, 1, sizeof(seq->coded_height), outfile ); - fwrite( &seq->ratio, 1, sizeof(seq->ratio), outfile ); - fwrite( &seq->profile, 1, sizeof(seq->profile), outfile ); + fwrite( &seq->coded_width, 1, sizeof(seq->coded_width), outfile ); + fwrite( &seq->coded_height, 1, sizeof(seq->coded_height), outfile ); + fwrite( &seq->ratio, 1, sizeof(seq->ratio), outfile ); + fwrite( &seq->profile, 1, sizeof(seq->profile), outfile ); } if ( nframes++ < 25 ) { - fwrite( &pic->vdp_infos, 1, sizeof(pic->vdp_infos), outfile ); - fwrite( &pic->slices_pos, 1, sizeof(pic->slices_pos), outfile ); - fwrite( pic->slices, 1, pic->slices_pos, outfile ); + fwrite( &pic->vdp_infos, 1, sizeof(pic->vdp_infos), outfile ); + fwrite( &pic->slices_pos, 1, sizeof(pic->slices_pos), outfile ); + fwrite( pic->slices, 1, pic->slices_pos, outfile ); } #endif @@ -942,6 +945,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre this->sequence.vdp_runtime_nr = runtime_nr; free_sequence( &this->sequence ); this->sequence.ratio = 1; + this->sequence.reset = VO_NEW_SEQUENCE_FLAG; init_picture( &this->sequence.picture ); |