mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
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:
parent
3a3a7c38aa
commit
e9682b938a
1 changed files with 6 additions and 2 deletions
|
@ -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) ||
|
||||
|
|
Loading…
Reference in a new issue