appsink: unref prev sample early

Kevin Song requested to merge into master

Appsink will unref prev sample in dispose function. Which is later when V4L2 video decoder link with appsink as V4L2 video decoder will close V4L2 device fd during GST_STATE_CHANGE_READY_TO_NULL. If the video buffer return to V4L2 video decoder after the decoder close V4L2 device node, V4L2 can't release the video frame buffer which allocated with MMAP mode as application can't call VIDIOC_REQBUFS 0 to release the video frame buffer by V4L2 driver. The memory of the video frame will be leaked. More unref prev sample to stop() function, so V4L2 video decoder can received all video frame buffer and release it before close V4L2 device fd.

Merge request reports