summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2009-05-25 15:21:52 +0200
committerEdward Hervey <bilboed@bilboed.com>2009-05-25 18:32:26 +0200
commit36cc757bdacbfbeadfce70040fd424b5e7bb2e8b (patch)
tree08f66de04a14d4fb61443906dd3870d59db85cce /gst
parentf92f282874addd1091e2d03b25033a12f151eb83 (diff)
downloadgst-plugins-bad-36cc757bdacbfbeadfce70040fd424b5e7bb2e8b.tar.gz
gst-plugins-bad-36cc757bdacbfbeadfce70040fd424b5e7bb2e8b.tar.bz2
gst-plugins-bad-36cc757bdacbfbeadfce70040fd424b5e7bb2e8b.zip
mpegtsdemux: Ignore NULL packets as early as possible.
This avoids: * creating a MpegTSStream structure for nothing * processing packet data for nothing
Diffstat (limited to 'gst')
-rw-r--r--gst/mpegdemux/gstmpegtsdemux.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gst/mpegdemux/gstmpegtsdemux.c b/gst/mpegdemux/gstmpegtsdemux.c
index a4d32e36..cd64a295 100644
--- a/gst/mpegdemux/gstmpegtsdemux.c
+++ b/gst/mpegdemux/gstmpegtsdemux.c
@@ -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;