After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 689814 - Memory allocated by GstVideoDecoder base class is not freed
Memory allocated by GstVideoDecoder base class is not freed
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
1.0.3
Other Windows
: Normal normal
: 1.0.4
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-12-06 21:34 UTC by Michael Rubinstein
Modified: 2012-12-10 11:54 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Michael Rubinstein 2012-12-06 21:34:30 UTC
In gstvideodecoder.c:

A call is made to gst_video_decoder_add_timestamp which allocates a 32 byte structure and a linked list element.

gst_video_decoder_get_timestamp_at_offset would free this memory, but it
is not called in my test cases.  This would happen in gst_video_decoder_have_frame, but it is not called.

I'm using the MPEG2 Video Decoder ("avdec_mpeg2video").
I'm pretty sure this applies to other video decoders.

It seems small, but, with overhead, it amounts to several MB/hr.
Comment 1 Sebastian Dröge (slomo) 2012-12-10 11:32:02 UTC
The timestamps are freed in _reset() and _get_timestamp_at_offset() (which is called from _have_frame()). So it shouldn't be leaked forever at least.

_have_frame() should be called by the subclass whenever it parsed a frame. But as the gst-libav video decoders don't parse anything this never happens. The baseclass shouldn't store the timestamps at all if the subclass doesn't want to parse anything.

Will fix that
Comment 2 Sebastian Dröge (slomo) 2012-12-10 11:54:05 UTC
commit 0bb5c6c012571d9ce7f80d9699a0d63f2768c271
Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
Date:   Mon Dec 10 11:49:46 2012 +0000

    videodecoder: Only keep track of timestamps if the subclass is parsing data
    
    Otherwise we just pass through the timestamps directly and don't
    need to waste additional memory for them.
    
    Fixes bug #689814.