[Bug 752409] dashdemux: gst_mpd_parser_get_stream_presentation_offset returns a wrong value

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Fri Jul 31 03:33:52 PDT 2015


https://bugzilla.gnome.org/show_bug.cgi?id=752409

--- Comment #3 from Chris Bass <floobleflam at gmail.com> ---
I think the patch is correct. presentationTimeOffset is used to apply an offset
to the presentation times of samples as indicated within the media (i.e., the
presentation times as given in the mp4 headers) so that different
AdaptationSets align with each other on the overall media presentation
timeline.

Subtracting presentationTimeOffset from the PTS of a sample in a media segment
will give you the timestamp of that sample relative to the start of its Period.
Where PeriodStart comes into the equation is in working out what the timestamp
of that sample should be relative to start of the overall media timeline: to
find the timestamp of that sample on the overall media timeline you would need
to do (PeriodStart + (sample_PTS - presentationTimeOffset)).

It looks like what the original code might possibly have been trying to do is
to return an offset that would allow you to directly calculate the timestamp of
a sample on the overall media timeline, rather than relative to PeriodStart(?).
However, it's based on an assumption that presentationTimeOffset should be >
PeriodStart, which isn't necessarily the case: it's perfectly acceptable for
presentationTimeOffset to be <= PeriodStart. For example, you could have a case
where a Period starts at 30s, but the PTSs in the first segment of that Period
start at 10s; in this case, PeriodStart would be 30s, and
presentationTimeOffset would be 10s.

You *could* have this function return the offset from sample PTSs to their
position on the overall media timeline, i.e., return (presentationTimeOffset -
PeriodStart) as a signed value. But I think that would probably be a bit
confusing; so probably better to return the presentationTimeOffset, as in the
patch. 

I'm guessing the returned value will probably be used to populate a newsegment
event pushed downstream at the start of a new Period. If so, I would have
thought you'd want segment.start to be presentationTimeOffset, and segment.time
to be PeriodStart...(?)

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list