Commit e9682b93 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller
Browse files

qtdemux: don't assert if upstream size is not available when guessing bitrates

Fixes abort in push mode where the source is not seekable and the
size of the file is not available, as with

  cat foo.mp4 | gst-launch-1.0 playbin uri=fd://0

Less noticable with releases, since we disable all
g_assert() there.

https://bugzilla.gnome.org/show_bug.cgi?id=686008
parent 3a3a7c38
......@@ -7636,7 +7636,8 @@ gst_qtdemux_guess_bitrate (GstQTDemux * qtdemux)
GST_DEBUG_OBJECT (qtdemux, "Looking for streams with unknown bitrate");
if (!gst_pad_peer_query_duration (qtdemux->sinkpad, GST_FORMAT_BYTES, &size)) {
if (!gst_pad_peer_query_duration (qtdemux->sinkpad, GST_FORMAT_BYTES, &size)
|| size <= 0) {
GST_DEBUG_OBJECT (qtdemux,
"Size in bytes of the stream not known - bailing");
return;
......@@ -7645,7 +7646,10 @@ gst_qtdemux_guess_bitrate (GstQTDemux * qtdemux)
/* Subtract the header size */
GST_DEBUG_OBJECT (qtdemux, "Total size %" G_GINT64_FORMAT ", header size %u",
size, qtdemux->header_size);
g_assert (size >= qtdemux->header_size);
if (size < qtdemux->header_size)
return;
size = size - qtdemux->header_size;
if (!gst_qtdemux_get_duration (qtdemux, &duration) ||
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment