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
This commit is contained in:
Tim-Philipp Müller 2012-10-13 00:03:29 +01:00
parent 3a3a7c38aa
commit e9682b938a

View file

@ -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) ||