mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-18 20:25:25 +00:00
mpegtsdemux: Ignore NULL packets as early as possible.
This avoids: * creating a MpegTSStream structure for nothing * processing packet data for nothing
This commit is contained in:
parent
f92f282874
commit
36cc757bda
1 changed files with 7 additions and 1 deletions
|
@ -2347,7 +2347,7 @@ static FORCE_INLINE GstFlowReturn
|
|||
gst_mpegts_demux_parse_transport_packet (GstMpegTSDemux * demux,
|
||||
const guint8 * data)
|
||||
{
|
||||
GstFlowReturn ret;
|
||||
GstFlowReturn ret = GST_FLOW_OK;
|
||||
guint16 PID;
|
||||
GstMpegTSStream *stream;
|
||||
|
||||
|
@ -2357,6 +2357,10 @@ gst_mpegts_demux_parse_transport_packet (GstMpegTSDemux * demux,
|
|||
/* get PID */
|
||||
PID = ((data[0] & 0x1f) << 8) | data[1];
|
||||
|
||||
/* Skip NULL packets */
|
||||
if (G_UNLIKELY (PID == 0x1fff))
|
||||
goto beach;
|
||||
|
||||
/* get the stream. */
|
||||
stream = gst_mpegts_demux_get_stream_for_PID (demux, PID);
|
||||
|
||||
|
@ -2387,6 +2391,8 @@ gst_mpegts_demux_parse_transport_packet (GstMpegTSDemux * demux,
|
|||
demux->num_packets = -1;
|
||||
}
|
||||
}
|
||||
|
||||
beach:
|
||||
demux->num_packets++;
|
||||
return ret;
|
||||
|
||||
|
|
Loading…
Reference in a new issue