mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-23 22:46:24 +00:00
gst/extend/discoverer.py: Avoid buffering infinite amounts of decoded data if a decoder is feeding us data without a ...
Original commit message from CVS: * gst/extend/discoverer.py: Avoid buffering infinite amounts of decoded data if a decoder is feeding us data without a duration (or with bad duration values).
This commit is contained in:
parent
f32834da5f
commit
26f5653a79
2 changed files with 19 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2006-11-15 Michael Smith <msmith@fluendo.com>
|
||||||
|
|
||||||
|
* gst/extend/discoverer.py:
|
||||||
|
Avoid buffering infinite amounts of decoded data if a decoder is
|
||||||
|
feeding us data without a duration (or with bad duration values).
|
||||||
|
|
||||||
2006-11-07 Edward Hervey <edward@fluendo.com>
|
2006-11-07 Edward Hervey <edward@fluendo.com>
|
||||||
|
|
||||||
* gst/extend/discoverer.py: Make the queue buffer up 1s of data before
|
* gst/extend/discoverer.py: Make the queue buffer up 1s of data before
|
||||||
|
|
|
@ -298,8 +298,19 @@ class Discoverer(gst.Pipeline):
|
||||||
# stream.
|
# stream.
|
||||||
queue.props.min_threshold_time = 1 * gst.SECOND
|
queue.props.min_threshold_time = 1 * gst.SECOND
|
||||||
queue.props.max_size_time = 2 * gst.SECOND
|
queue.props.max_size_time = 2 * gst.SECOND
|
||||||
queue.props.max_size_buffers = 0
|
|
||||||
queue.props.max_size_bytes = 0
|
queue.props.max_size_bytes = 0
|
||||||
|
|
||||||
|
# If durations are bad on the buffers (common for video decoders), we'll
|
||||||
|
# never reach the min_threshold_time or max_size_time. So, set a large
|
||||||
|
# max size in buffers, and if reached, disable the min_threshold_time.
|
||||||
|
# This ensures we don't fail to discover with various ffmpeg
|
||||||
|
# demuxers/decoders that provide bogus (or no) duration.
|
||||||
|
queue.props.max_size_buffers = 100
|
||||||
|
def _disable_min_threshold_cb(queue):
|
||||||
|
queue.props.min_threshold_time = 0
|
||||||
|
queue.disconnect(signal_id)
|
||||||
|
signal_id = queue.connect('overrun', _disable_min_threshold_cb)
|
||||||
|
|
||||||
self.add(fakesink, queue)
|
self.add(fakesink, queue)
|
||||||
queue.link(fakesink)
|
queue.link(fakesink)
|
||||||
sinkpad = fakesink.get_pad("sink")
|
sinkpad = fakesink.get_pad("sink")
|
||||||
|
|
Loading…
Reference in a new issue