summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJulian Scheel <julian@jusst.de>2010-02-06 14:39:59 +0100
committerJulian Scheel <julian@jusst.de>2010-02-06 14:39:59 +0100
commitfff2bcb1a05c79f4aabd93236d972153ded4c871 (patch)
treedf83ac46a7c49168c5695b5f45d95b35a6fc96ea /src
parent5ad9b425c3c1273d7fda175f785a1e05f98aa3c9 (diff)
downloadxine-lib-fff2bcb1a05c79f4aabd93236d972153ded4c871.tar.gz
xine-lib-fff2bcb1a05c79f4aabd93236d972153ded4c871.tar.bz2
Fix leakage of vo_frame_t on reset/flush/dispose
If a decoded_pic was locally cached, because it is the first half of a reference picture it would not get freed in case of a reset/flush/dispose.
Diffstat (limited to 'src')
-rw-r--r--src/video_dec/libvdpau/vdpau_h264.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/video_dec/libvdpau/vdpau_h264.c b/src/video_dec/libvdpau/vdpau_h264.c
index 28d455f39..18a117508 100644
--- a/src/video_dec/libvdpau/vdpau_h264.c
+++ b/src/video_dec/libvdpau/vdpau_h264.c
@@ -696,13 +696,21 @@ static void vdpau_h264_flush (video_decoder_t *this_gen) {
vdpau_h264_decoder_t *this = (vdpau_h264_decoder_t*) this_gen;
struct decoded_picture *decoded_pic = NULL;
+ if(this->dangling_img)
+ this->dangling_img->free(this->dangling_img);
+ this->last_img = this->dangling_img = NULL;
+
+ if (this->last_ref_pic) {
+ release_decoded_picture(this->last_ref_pic);
+ this->last_ref_pic = NULL;
+ }
+
while ((decoded_pic = dpb_get_next_out_picture(&(this->nal_parser->dpb), 1)) != NULL) {
decoded_pic->img->top_field_first = dp_top_field_first(decoded_pic);
xprintf(this->xine, XINE_VERBOSITY_DEBUG,
"h264 flush, draw pts: %lld\n", decoded_pic->img->pts);
decoded_pic->img->draw(decoded_pic->img, this->stream);
dpb_set_output_picture(&(this->nal_parser->dpb), decoded_pic);
- this->last_img = NULL;
}
dpb_free_all(&this->nal_parser->dpb);
this->reset = VO_NEW_SEQUENCE_FLAG;
@@ -737,6 +745,11 @@ static void vdpau_h264_reset (video_decoder_t *this_gen) {
this->wait_for_frame_start = this->have_frame_boundary_marks;
}
+ if (this->last_ref_pic) {
+ release_decoded_picture(this->last_ref_pic);
+ this->last_ref_pic = NULL;
+ }
+
if (this->dangling_img) {
this->dangling_img->free(this->dangling_img);
this->dangling_img = NULL;
@@ -764,6 +777,11 @@ static void vdpau_h264_dispose (video_decoder_t *this_gen) {
vdpau_h264_decoder_t *this = (vdpau_h264_decoder_t *) this_gen;
+ if (this->last_ref_pic) {
+ release_decoded_picture(this->last_ref_pic);
+ this->last_ref_pic = NULL;
+ }
+
if (this->dangling_img) {
this->dangling_img->free(this->dangling_img);
this->dangling_img = NULL;