summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2015-06-25 23:24:50 +0200
committerSebastian Dröge <sebastian@centricular.com>2015-06-25 23:36:10 +0200
commit626a8f0a74f8ea748b811b74ba9e7ae2baea2cca (patch)
tree9c9d4137231234e68a55534f3be630d3256d79ff
parent95eb1aa49c130bb2f58ec6712bd8cb8b61326b99 (diff)
downloadgstreamer-plugins-bad-626a8f0a74f8ea748b811b74ba9e7ae2baea2cca.tar.gz
dashdemux: Subtract the period start time from the presentation offset
We're interested in the offset between the period start timestamp and the actual media timestamp so that we can properly correct for it. The absolute presentation offset to timestamp 0 is useless as the only thing we really care about is the offset between the current fragment timestamp and the media timestamp.
-rw-r--r--ext/dash/gstmpdparser.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/dash/gstmpdparser.c b/ext/dash/gstmpdparser.c
index d5f99564a..e7420ec2e 100644
--- a/ext/dash/gstmpdparser.c
+++ b/ext/dash/gstmpdparser.c
@@ -3761,13 +3761,17 @@ gst_mpd_parser_get_stream_presentation_offset (GstMpdClient * client,
guint stream_idx)
{
GstActiveStream *stream = NULL;
+ GstStreamPeriod *stream_period = gst_mpdparser_get_stream_period (client);
g_return_val_if_fail (client != NULL, FALSE);
g_return_val_if_fail (client->active_streams != NULL, FALSE);
stream = g_list_nth_data (client->active_streams, stream_idx);
g_return_val_if_fail (stream != NULL, FALSE);
- return stream->presentationTimeOffset;
+ if (stream->presentationTimeOffset > stream_period->start)
+ return stream->presentationTimeOffset - stream_period->start;
+ else
+ return 0;
}
gboolean