diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2016-08-25 19:35:13 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2016-08-25 19:52:37 +0300 |
commit | 4f6ae1f48c2a139faf07958b9e2232da8dde1b83 (patch) | |
tree | ce18fe51672422c11fd4a578cd4b02223a3e8567 /ext/dash | |
parent | 2702d98d6bfb12d96ffcfc7521e575dbbbf235a5 (diff) | |
download | gstreamer-plugins-bad-4f6ae1f48c2a139faf07958b9e2232da8dde1b83.tar.gz |
adaptivedemux: Enable bitrate selection for trick mode streaming again
And scale the bitrate with the absolute rate (if it's bigger than 1.0) to get
to the real bitrate due to faster playback.
This allowed in my tests to play a stream with 10x speed without buffering as
the lowest bitrate is chosen, instead of staying/selecting the highest bitrate
and then buffering all the time.
It was previously disabled for not very well specified reasons, which seem to
be not valid anymore nowadays.
Diffstat (limited to 'ext/dash')
-rw-r--r-- | ext/dash/gstdashdemux.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/ext/dash/gstdashdemux.c b/ext/dash/gstdashdemux.c index 5fe629c3f..2b29a1de8 100644 --- a/ext/dash/gstdashdemux.c +++ b/ext/dash/gstdashdemux.c @@ -1437,6 +1437,7 @@ gst_dash_demux_stream_select_bitrate (GstAdaptiveDemuxStream * stream, GstActiveStream *active_stream = NULL; GList *rep_list = NULL; gint new_index; + GstAdaptiveDemux *base_demux = stream->demux; GstDashDemux *demux = GST_DASH_DEMUX_CAST (stream->demux); GstDashDemuxStream *dashstream = (GstDashDemuxStream *) stream; gboolean ret = FALSE; @@ -1457,7 +1458,15 @@ gst_dash_demux_stream_select_bitrate (GstAdaptiveDemuxStream * stream, "Trying to change to bitrate: %" G_GUINT64_FORMAT, bitrate); /* get representation index with current max_bandwidth */ - new_index = gst_mpdparser_get_rep_idx_with_max_bandwidth (rep_list, bitrate); + if ((base_demux->segment.flags & GST_SEGMENT_FLAG_TRICKMODE_KEY_UNITS) || + ABS (base_demux->segment.rate) <= 1.0) { + new_index = + gst_mpdparser_get_rep_idx_with_max_bandwidth (rep_list, bitrate); + } else { + new_index = + gst_mpdparser_get_rep_idx_with_max_bandwidth (rep_list, + bitrate / ABS (base_demux->segment.rate)); + } /* if no representation has the required bandwidth, take the lowest one */ if (new_index == -1) |