summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
authorZaheer Abbas Merali <zaheerabbas@merali.org>2008-10-16 08:13:49 +0000
committerZaheer Abbas Merali <zaheerabbas@merali.org>2008-10-16 08:13:49 +0000
commit9a808ad30ae1de953b0c6813a53c02d14994de70 (patch)
treec65ee577ff0e4e7cb398f704183d133a57d61b6f /gst
parentf1c7c8cea0d06011c42875d588afe2c6781b60fb (diff)
downloadgst-plugins-bad-9a808ad30ae1de953b0c6813a53c02d14994de70.tar.gz
gst-plugins-bad-9a808ad30ae1de953b0c6813a53c02d14994de70.tar.bz2
gst-plugins-bad-9a808ad30ae1de953b0c6813a53c02d14994de70.zip
gst/mpegdemux/gstmpegtsdemux.c: Fixes a segfault in the adaptation buffer size strategy.
Original commit message from CVS: patch by: Josep Torra * gst/mpegdemux/gstmpegtsdemux.c: Fixes a segfault in the adaptation buffer size strategy. Fixes #556440
Diffstat (limited to 'gst')
-rw-r--r--gst/mpegdemux/gstmpegtsdemux.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gst/mpegdemux/gstmpegtsdemux.c b/gst/mpegdemux/gstmpegtsdemux.c
index 7ccbab8b..6ac05031 100644
--- a/gst/mpegdemux/gstmpegtsdemux.c
+++ b/gst/mpegdemux/gstmpegtsdemux.c
@@ -2206,19 +2206,22 @@ gst_fluts_demux_parse_stream (GstFluTSDemux * demux, GstFluTSStream * stream,
GST_DEBUG_OBJECT (demux, "new PES start for PID 0x%04x, used %u"
"bytes of %u bytes in the PES buffer",
PID, stream->pes_buffer_used, stream->pes_buffer_size);
+ /* Flush buffered PES data */
+ ret = gst_fluts_stream_pes_buffer_flush (stream);
+ gst_pes_filter_drain (&stream->filter);
/* Resize the buffer to half if no overflow detected and
* had been used less than half of it */
if (stream->pes_buffer_overflow == FALSE
&& stream->pes_buffer_used < (stream->pes_buffer_size >> 1)) {
stream->pes_buffer_size >>= 1;
+ if (stream->pes_buffer_size < FLUTS_MIN_PES_BUFFER_SIZE)
+ stream->pes_buffer_size = FLUTS_MIN_PES_BUFFER_SIZE;
GST_DEBUG_OBJECT (demux, "PES buffer size reduced to %u bytes",
stream->pes_buffer_size);
}
+ if (ret == GST_FLOW_LOST_SYNC)
+ goto done;
stream->pes_buffer_overflow = FALSE;
-
- /* Flush buffered PES data */
- gst_fluts_stream_pes_buffer_flush (stream);
- gst_pes_filter_drain (&stream->filter);
}
GST_LOG_OBJECT (demux, "Elementary packet of size %u for PID 0x%04x",
datalen, PID);