From dc70c32e0f7614f52958e1b37da5b215aaafaafe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhard=20Ni=C3=9Fl?= Date: Sun, 23 Jan 2011 00:59:24 +0100 Subject: Avoid "broken stream" message in vdpau_decoder_render, caused by decoder_init The image allocated in decoder_init can immediately be freed after getting access to accel_data. Accessing the accel pointer afterwards is safe for non frame related functions although the frame has been freed as freed frames are not deallocated but put into a free frame queue. --- src/video_dec/libvdpau/vdpau_h264.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/video_dec/libvdpau/vdpau_h264.c b/src/video_dec/libvdpau/vdpau_h264.c index e16c800a7..5c4edc6c3 100644 --- a/src/video_dec/libvdpau/vdpau_h264.c +++ b/src/video_dec/libvdpau/vdpau_h264.c @@ -420,18 +420,11 @@ static int vdpau_decoder_init(video_decoder_t *this_gen) XINE_IMGFMT_VDPAU, VO_BOTH_FIELDS | this->reset); this->reset = 0; - img->duration = this->video_step; - img->pts = this->completed_pic->pts; - - if (this->dangling_img) { - xprintf(this->xine, XINE_VERBOSITY_LOG, - "broken stream: current img wasn't processed -- freeing it\n!"); - this->dangling_img->free(this->dangling_img); - } - this->dangling_img = img; - this->vdpau_accel = (vdpau_accel_t*)img->accel_data; + img->free(img); + img = NULL; + /*VdpBool is_supported; uint32_t max_level, max_references, max_width, max_height;*/ if(this->vdpau_accel->vdp_runtime_nr > 0) { -- cgit v1.2.3