GNOME Bugzilla – Bug 706076
qtdemux: failed assertion for fragmented mp4 (DASH) streams
Last modified: 2013-08-16 08:15:07 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.
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