From 9f95af243b2a3845e4e37bafa53f44760a3586df Mon Sep 17 00:00:00 2001 From: Christophe Thommeret Date: Fri, 19 Dec 2008 14:08:24 +0000 Subject: Release refframes at reset/dispose. --- src/libvdpau/vdpau_h264.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src') diff --git a/src/libvdpau/vdpau_h264.c b/src/libvdpau/vdpau_h264.c index e8b0088e4..9d461063b 100644 --- a/src/libvdpau/vdpau_h264.c +++ b/src/libvdpau/vdpau_h264.c @@ -517,7 +517,23 @@ static void vdpau_h264_flush (video_decoder_t *this_gen) { static void vdpau_h264_reset (video_decoder_t *this_gen) { vdpau_h264_decoder_t *this = (vdpau_h264_decoder_t *) this_gen; + printf("vdpau_h264_reset\n"); + this->size = 0; + + dpb_flush( &(this->nal_parser->dpb) ); + + if (this->decoder_initialized) + this->vdpau_accel->vdp_decoder_destroy( this->decoder ); + + this->decoder_started = 0; + this->decoder_initialized = 0; + this->nal_parser = init_parser(); + this->buf = NULL; + this->wait_for_bottom_field = 0; + this->video_step = 0; + this->last_pts = 0; + this->tmp_pts = 0; } /* @@ -540,6 +556,8 @@ static void vdpau_h264_dispose (video_decoder_t *this_gen) { this->buf = NULL; } + dpb_flush( &(this->nal_parser->dpb) ); + if (this->decoder_initialized) { this->vdpau_accel->vdp_decoder_destroy( this->decoder ); this->decoder_initialized = 0; -- cgit v1.2.3