GNOME Bugzilla – Bug 750804
dashdemux: incorrectly calculates presentationTimeOffset if the value is larger than 2^32
Last modified: 2015-06-11 17:41:32 UTC
If the presentationTimeOffset attribute of a DASH manifest contains a value that is larger than 2^32, gstmpdparser incorrectly calculates the stream's presentation time offset. For example, the following manifest produces an incorrect value for stream->presentationTimeOffset: <?xml version="1.0" encoding="UTF-8"?> <MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd" type="dynamic" minimumUpdatePeriod="P42Y" minBufferTime="PT5.000S" maxSegmentDuration="PT4.080S" availabilityStartTime="2015-06-11T16:11:00Z" timeShiftBufferDepth="PT24.000S" profiles="urn:mpeg:dash:profile:isoff-live:2011"> <Period id="0" start="PT0S"> <AdaptationSet mimeType="video/mp4" segmentAlignment="true" startWithSAP="1" maxWidth="704" maxHeight="396" maxFrameRate="25" par="16:9"> <SegmentTemplate timescale="90000" initialization="$RepresentationID$/Header.m4s" media="$RepresentationID$/$Number$.m4s" duration="360000" startNumber="918471" presentationTimeOffset="325434516507"/> <Representation id="video1" width="704" height="396" frameRate="25" sar="1:1" scanType="progressive" bandwidth="1200000" codecs="avc1.4D401E"/> </AdaptationSet> </Period> </MPD> The correct GstClockTime should be 1004:25:39.0723
Created attachment 305087 [details] [review] dashdemux: fix error calculating large presentation time offset If the presentationTimeOffset attribute of a DASH manifest contains a value that is larger than 2^32, gstmpdparser incorrectly calculates the stream's presentation time offset. This is due to two bugs: 1: Using gst_mpdparser_get_xml_prop_unsigned_integer rather than gst_mpdparser_get_xml_prop_unsigned_integer_64 to parse the attribute 2: gst_mpd_client_setup_representation multiplies the value by GST_SECOND and then divides by timescale, causing 64 bit overflow
commit 5beeccdba283970f0c61b31927d75f046a962e0e Author: Alex Ashley <bugzilla@ashley-family.net> Date: Thu Jun 11 17:25:49 2015 +0100 dashdemux: fix error calculating large presentationTimeOffset values If the presentationTimeOffset attribute of a DASH manifest contains a value that is larger than 2^32, gstmpdparser incorrectly calculates the stream's presentation time offset. This is due to two bugs: 1: Using gst_mpdparser_get_xml_prop_unsigned_integer rather than gst_mpdparser_get_xml_prop_unsigned_integer_64 to parse the attribute 2: gst_mpd_client_setup_representation multiplying the value by GST_SECOND and then dividing by timescale https://bugzilla.gnome.org/show_bug.cgi?id=750804