[Bug 696770] New: Memory leak when processing h.264 field pictures

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Thu Mar 28 04:52:52 PDT 2013


https://bugzilla.gnome.org/show_bug.cgi?id=696770
  GStreamer | gst-libav | 1.0.5

           Summary: Memory leak when processing h.264 field pictures
    Classification: Platform
           Product: GStreamer
           Version: 1.0.5
        OS/Version: Windows
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-libav
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: mrubinstein at weather.com
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


Our application demuxes, parses and decodes a live h.264 transport stream.
The input consists, mostly, of "field picutres".  These seem to decode
properly.

The decoder produces one output frame for each pair of input buffers, as
expected.  However, some memory is not free'd.

Three related items are not free'd.

1.  The input buffer created by the parser.
2.  A GstVideoCodecFrame allocated by GstVideoDecoder.  It has a reference to
the buffer.
3.  A linked list element used to keep a list of active frames in
GstVideoDecoder. The list is in _GstVideoDecoderPrivate.frames.

GstVideoDecoder will release the memory in question if
gst_video_decoder_drop_frame or gst_video_decoder_finish_frame is called.

GstFFMpegVidDec (gst-libav\ext\libav\gstavviddec.c) calls
gst_video_decoder_finish_frame for each output frame, but doesn't call anything
for the other field picture.

I tried calling gst_video_decoder_finish_frame as well as some other ways of
releasing the memory but couldn't find a reliable way to release the memory
without releasing memory that the decoder was still using.

As an experiment, I tried releasing old frames when the GstVideoDecoder frame
list grew longer than 100 frames.  This fixed the memory leak.  I don't think
that this a solution, but it does help validate the above analysis.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list