[Bug 689936] New: Leak when skipping frames while Video Decoding

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Sun Dec 9 08:48:13 PST 2012


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

           Summary: Leak when skipping frames while Video Decoding
    Classification: Platform
           Product: GStreamer
           Version: 1.0.3
        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: ---


Memory was leaked in a pipeline that does MPEG2 Video decoding.  The leaks
occurred when there was a discontinutiy in the input transport stream.

In /ext/libav/gstavviddec.c we're supposed to call either:
 gst_video_decoder_finish_frame or
 gst_video_decoder_drop_frame
to finish frame processing.

When qos processing determines that we should skip a frame, we, sometimes,
don't call either function.

This results in a memory leak of, at least, GstVideoCodecFrame objects.

I'm not clear on how to handle the return values of avcodec_decode_video2, so I
disabled frame skipping as an experiment.  That fixed the leak.

--- a/ext/libav/gstavviddec.c
+++ b/ext/libav/gstavviddec.c
@@ -1086,6 +1086,14 @@ gst_ffmpegviddec_video_frame (GstFFMpegVidDec *
ffmpegdec,
    * else we might skip a reference frame */
   decode = gst_ffmpegviddec_do_qos (ffmpegdec, frame, &mode_switch);

+  // twc/mlr: temp
+  if (!decode)
+  {
+    GST_INFO("Not skipping");
+  }
+  decode = TRUE;
+  ffmpegdec->context->skip_frame = AVDISCARD_DEFAULT;
+
   if (ffmpegdec->is_realvideo && data != NULL) {

-- 
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