decoder: fix memory leak when processing interlaced pictures.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Tue, 11 Jun 2013 13:11:34 +0000 (15:11 +0200)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Mon, 15 Jul 2013 12:01:06 +0000 (14:01 +0200)
commit1fff3a44dde33a3d817a47a72cf7bb1ecb9c3bf7
tree5537e631cf8f6962382641ffa3a6b4f807c988b3
parentcee9101dd8932fdfc426c51d28ccd17db97cc045
decoder: fix memory leak when processing interlaced pictures.

Fix memory leak when processing interlaced pictures and that occurs
because the first field, represented as a GstVideoCodecFrame, never
gets released. i.e. when the picture is completed, this is generally
the case when the second field is successfully decoded, we need to
propagate the GstVideoCodecFrame of the first field to the original
GstVideoDecoder so that it could reclaim memory.

Otherwise, we keep accumulating the first fields into GstVideoDecoder
private frames list until the end-of-stream is reached. The frames
are eventually released there, but too late, i.e. too much memory
may have been consumed.

https://bugzilla.gnome.org/show_bug.cgi?id=701257
gst-libs/gst/vaapi/gstvaapidecoder_objects.c
gst-libs/gst/vaapi/gstvaapidecoder_objects.h