summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2017-03-08 15:27:32 +0200
committerSebastian Dröge <sebastian@centricular.com>2017-03-17 12:32:10 +0200
commit0cb502a62cd7869185dddbc9935f878badd1d03a (patch)
treed76dec8afff2ed699fc39364fbc1ed7b9517c176
parentae62fcb7933ef7728e45eadf0b3e7c26ee4b243c (diff)
downloadgstreamer-plugins-good-0cb502a62cd7869185dddbc9935f878badd1d03a.tar.gz
qtmux: Fix some memory leaks related to timecode tracks
-rw-r--r--gst/isomp4/atoms.c12
-rw-r--r--gst/isomp4/gstqtmux.c5
2 files changed, 16 insertions, 1 deletions
diff --git a/gst/isomp4/atoms.c b/gst/isomp4/atoms.c
index f1ec6bcd2..8ada78be0 100644
--- a/gst/isomp4/atoms.c
+++ b/gst/isomp4/atoms.c
@@ -566,6 +566,14 @@ sample_entry_tmcd_new (void)
}
static void
+sample_entry_tmcd_free (SampleTableEntryTMCD * tmcd)
+{
+ atom_sample_entry_free (&tmcd->se);
+ g_free (tmcd->name.name);
+ g_free (tmcd);
+}
+
+static void
sample_entry_mp4v_init (SampleTableEntryMP4V * mp4v, AtomsContext * context)
{
atom_sample_entry_init (&mp4v->se, FOURCC_mp4v);
@@ -674,6 +682,9 @@ atom_stsd_remove_entries (AtomSTSD * stsd)
case SUBTITLE:
sample_entry_tx3g_free ((SampleTableEntryTX3G *) se);
break;
+ case TIMECODE:
+ sample_entry_tmcd_free ((SampleTableEntryTMCD *) se);
+ break;
default:
/* best possible cleanup */
atom_sample_entry_free (se);
@@ -3757,6 +3768,7 @@ atom_trak_add_timecode_entry (AtomTRAK * trak, AtomsContext * context,
trak->mdia.hdlr.component_type = FOURCC_mhlr;
trak->mdia.hdlr.handler_type = FOURCC_tmcd;
+ g_free (trak->mdia.hdlr.name);
trak->mdia.hdlr.name = g_strdup ("Time Code Media Handler");
trak->mdia.mdhd.time_info.timescale = tc->config.fps_n / tc->config.fps_d;
diff --git a/gst/isomp4/gstqtmux.c b/gst/isomp4/gstqtmux.c
index 643a4ced6..db26296b5 100644
--- a/gst/isomp4/gstqtmux.c
+++ b/gst/isomp4/gstqtmux.c
@@ -504,7 +504,6 @@ gst_qt_mux_pad_reset (GstQTPad * qtpad)
qtpad->total_duration = 0;
qtpad->total_bytes = 0;
qtpad->sparse = FALSE;
- qtpad->tc_trak = NULL;
qtpad->buf_head = 0;
qtpad->buf_tail = 0;
@@ -518,6 +517,7 @@ gst_qt_mux_pad_reset (GstQTPad * qtpad)
/* reference owned elsewhere */
qtpad->trak = NULL;
+ qtpad->tc_trak = NULL;
if (qtpad->traf) {
atom_traf_free (qtpad->traf);
@@ -605,6 +605,9 @@ gst_qt_mux_reset (GstQTMux * qtmux, gboolean alloc)
qtmux->reserved_duration_remaining = GST_CLOCK_TIME_NONE;
qtmux->first_pts = GST_CLOCK_TIME_NONE;
qtmux->tc_pos = -1;
+ if (qtmux->first_tc)
+ gst_video_time_code_free (qtmux->first_tc);
+ qtmux->first_tc = NULL;
}
static void