From: Edward Hervey Date: Sun, 12 Jun 2011 09:27:30 +0000 (+0200) Subject: tsdemux: Don't free unexistent PAT X-Git-Tag: 1.19.3~507^2~16050^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b3ef72f2eb49be3dcc7a103635e6fe864e7f7072;p=platform%2Fupstream%2Fgstreamer.git tsdemux: Don't free unexistent PAT And cleanup find_timestamps a bit --- diff --git a/gst/mpegtsdemux/tsdemux.c b/gst/mpegtsdemux/tsdemux.c index e001e8b312..b602ab7c14 100644 --- a/gst/mpegtsdemux/tsdemux.c +++ b/gst/mpegtsdemux/tsdemux.c @@ -1654,6 +1654,12 @@ find_timestamps (MpegTSBase * base, guint64 initoff, guint64 * offset) /* Search for the first PCRs */ ret = process_pcr (base, base->first_pat_offset, &initial, 10, TRUE); + + if (ret != GST_FLOW_OK && ret != GST_FLOW_UNEXPECTED) { + GST_WARNING ("Problem getting initial PCRs"); + goto beach; + } + mpegts_packetizer_clear (base->packetizer); /* Remove current program so we ensure looking for a PAT when scanning the * for the final PCR */ @@ -1661,11 +1667,6 @@ find_timestamps (MpegTSBase * base, guint64 initoff, guint64 * offset) base->pat = NULL; mpegts_base_remove_program (base, demux->current_program_number); - if (ret != GST_FLOW_OK && ret != GST_FLOW_UNEXPECTED) { - GST_WARNING ("Problem getting initial PCRs"); - goto beach; - } - /* Find end position */ if (G_UNLIKELY (!gst_pad_query_peer_duration (base->sinkpad, &format, &total_bytes) || format != GST_FORMAT_BYTES)) { @@ -1718,8 +1719,10 @@ beach: mpegts_packetizer_clear (base->packetizer); /* Remove current program */ - gst_structure_free (base->pat); - base->pat = NULL; + if (base->pat) { + gst_structure_free (base->pat); + base->pat = NULL; + } mpegts_base_remove_program (base, demux->current_program_number); return ret;