After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 706076 - qtdemux: failed assertion for fragmented mp4 (DASH) streams
qtdemux: failed assertion for fragmented mp4 (DASH) streams
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.1.4
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-08-15 14:24 UTC by Chris Bass
Modified: 2013-08-16 08:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to avoid failed assertion (926 bytes, patch)
2013-08-15 14:24 UTC, Chris Bass
committed Details | Review

Description Chris Bass 2013-08-15 14:24:10 UTC
Created attachment 251744 [details] [review]
Patch to avoid failed assertion

When using qtdemux to play a DASH stream in which the moov boxes in the initialisation segments contain an mehd box (which contains the overall stream duration), the following assertion is thrown on representation switches:

gst-launch-1.0:6203): GStreamer-CRITICAL **: _gst_util_uint64_scale_int: assertion `denom > 0' failed

The reason this happens is that stream->n_samples is used in gst_qtdemux_configure_stream as the denominator argument to gst_util_uint64_scale_int_round (when calculating stream->fps_d, line 5602); but for fragmented mp4 streams n_samples can be zero at that point.

In a fragmented mp4 stream, the number of samples in each track isn't recorded in any of the boxes contained within the moov box (the moov box is in the initialisation segment, which contains no samples, so sampleCount in the stsz box is 0); therefore, the value of n_samples for a stream may be zero when gst_qtdemux_configure_stream tries to set fps_d.

I've attached a patch that will check that n_samples is non-zero before using it as a denominator, thus avoiding the failed assertion.
Comment 1 Sebastian Dröge (slomo) 2013-08-16 08:15:03 UTC
Do you have a testcase to reproduce this?

commit 3e9dea3f8cb9f6ee46781f3cb611a0a39d7811d3
Author: Chris Bass <floobleflam@gmail.com>
Date:   Thu Aug 15 10:59:10 2013 +0100

    qtdemux: check denominator isn't zero before scaling duration.
    
    When gst_qtdemux_configure_stream sets fps_d, check that n_samples is
    non-zero before using it as a denominator to scale the stream duration.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=706076