mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
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
This commit is contained in:
parent
f1c7c8cea0
commit
9a808ad30a
2 changed files with 15 additions and 4 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2008-10-15 Zaheer Abbas Merali <zaheerabbas at merali dot org>
|
||||||
|
|
||||||
|
patch by: Josep Torra
|
||||||
|
|
||||||
|
* gst/mpegdemux/gstmpegtsdemux.c:
|
||||||
|
Fixes a segfault in the adaptation buffer size strategy.
|
||||||
|
Fixes #556440
|
||||||
|
|
||||||
2008-10-15 Edward Hervey <edward.hervey@collabora.co.uk>
|
2008-10-15 Edward Hervey <edward.hervey@collabora.co.uk>
|
||||||
|
|
||||||
* gst/selector/gstinputselector.c: (gst_input_selector_event),
|
* gst/selector/gstinputselector.c: (gst_input_selector_event),
|
||||||
|
|
|
@ -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"
|
GST_DEBUG_OBJECT (demux, "new PES start for PID 0x%04x, used %u"
|
||||||
"bytes of %u bytes in the PES buffer",
|
"bytes of %u bytes in the PES buffer",
|
||||||
PID, stream->pes_buffer_used, stream->pes_buffer_size);
|
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
|
/* Resize the buffer to half if no overflow detected and
|
||||||
* had been used less than half of it */
|
* had been used less than half of it */
|
||||||
if (stream->pes_buffer_overflow == FALSE
|
if (stream->pes_buffer_overflow == FALSE
|
||||||
&& stream->pes_buffer_used < (stream->pes_buffer_size >> 1)) {
|
&& stream->pes_buffer_used < (stream->pes_buffer_size >> 1)) {
|
||||||
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",
|
GST_DEBUG_OBJECT (demux, "PES buffer size reduced to %u bytes",
|
||||||
stream->pes_buffer_size);
|
stream->pes_buffer_size);
|
||||||
}
|
}
|
||||||
|
if (ret == GST_FLOW_LOST_SYNC)
|
||||||
|
goto done;
|
||||||
stream->pes_buffer_overflow = FALSE;
|
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",
|
GST_LOG_OBJECT (demux, "Elementary packet of size %u for PID 0x%04x",
|
||||||
datalen, PID);
|
datalen, PID);
|
||||||
|
|
Loading…
Reference in a new issue