diff options
author | prasanth kamuju <prasanth.kamuju@linaro.org> | 2014-12-15 16:45:08 +0530 |
---|---|---|
committer | prasanth kamuju <prasanth.kamuju@linaro.org> | 2014-12-15 16:45:08 +0530 |
commit | b1fe03764032323835e311315a0ffb585f20b082 (patch) | |
tree | 7ffe28ccd32b74ec7b08df3d51a3041c5a8a9a05 | |
parent | 7ee74a04ba10401a7c7f92026a95f3007e281756 (diff) |
qcvideodec: Memory leak
Call the ioctl to free the input buffers and then
unmap the input buffers.
-rw-r--r-- | src/gstqcvideodec.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/gstqcvideodec.c b/src/gstqcvideodec.c index 296d6ea..dab8e77 100644 --- a/src/gstqcvideodec.c +++ b/src/gstqcvideodec.c @@ -695,6 +695,17 @@ int free_buffer ( enum vdec_buffer buffer_dir,Gstqcvideodec *decoder_context) { if (ptemp [i].pmem_fd != -1) { + setbuffers.buffer_type = VDEC_BUFFER_TYPE_INPUT; + memcpy (&setbuffers.buffer,&dec->ptr_inputbuffer[i],sizeof (struct vdec_bufferpayload)); + ioctl_msg.in = &setbuffers; + ioctl_msg.out = NULL; + + if (ioctl (dec->video_driver_fd, VDEC_IOCTL_FREE_BUFFER, + &ioctl_msg) < 0) + { + GST_ERROR("\n Release output buffer failed in VCD"); + } + munmap ( ptemp [i].bufferaddr,ptemp [i].mmaped_size); ptemp [i].bufferaddr = NULL; close (ptemp [i].pmem_fd); @@ -720,11 +731,11 @@ int free_buffer ( enum vdec_buffer buffer_dir,Gstqcvideodec *decoder_context) GST_ERROR("\n ION: close(%d) failed", dec->h264_mv.fd_ion_data.fd); } - if(ioctl(dec->h264_mv.ion_device_fd,ION_IOC_FREE, + /* if(ioctl(dec->h264_mv.ion_device_fd,ION_IOC_FREE, &dec->h264_mv.ion_alloc_data.handle)) { GST_ERROR("\n ION: free failed, dev_fd = %d, handle = 0x%p", dec->h264_mv.ion_device_fd, dec->h264_mv.ion_alloc_data.handle); - } + }*/ dec->h264_mv.ion_device_fd = -1; dec->h264_mv.ion_alloc_data.handle = NULL; dec->h264_mv.fd_ion_data.fd = -1; |