demux->n_subtitle_streams = 0;
demux->trickmode_no_audio = FALSE;
+ demux->allow_trickmode_key_units = TRUE;
}
static GstCaps *
static gboolean
gst_dash_demux_need_another_chunk (GstAdaptiveDemuxStream * stream)
{
+ GstDashDemux *dashdemux = (GstDashDemux *) stream->demux;
GstDashDemuxStream *dashstream = (GstDashDemuxStream *) stream;
/* We're chunked downloading for ISOBMFF in KEY_UNITS mode for the actual
&& (GST_ADAPTIVE_DEMUX (stream->demux)->
segment.flags & GST_SEGMENT_FLAG_TRICKMODE_KEY_UNITS)
&& dashstream->active_stream->mimeType == GST_STREAM_VIDEO
- && !stream->downloading_header && !stream->downloading_index) {
+ && !stream->downloading_header && !stream->downloading_index
+ && dashdemux->allow_trickmode_key_units) {
if (dashstream->isobmff_parser.current_fourcc != GST_ISOFF_FOURCC_MDAT) {
stream->fragment.chunk_size = 8192;
} else if (dashstream->moof && dashstream->moof_sync_samples) {
} else {
stream->fragment.chunk_size = -1;
}
-
- return stream->fragment.chunk_size != 0;
+ } else {
+ /* We might've decided that we can't allow key-unit only
+ * trickmodes while doing chunked downloading. In that case
+ * just download from here to the end now */
+ if (dashstream->moof)
+ stream->fragment.chunk_size = -1;
+ else
+ stream->fragment.chunk_size = 0;
}
- stream->fragment.chunk_size = 0;
-
- return FALSE;
+ return stream->fragment.chunk_size != 0;
}
static GstBuffer *
gst_dash_demux_find_sync_samples (GstAdaptiveDemux * demux,
GstAdaptiveDemuxStream * stream)
{
+ GstDashDemux *dashdemux = (GstDashDemux *) stream->demux;
GstDashDemuxStream *dash_stream = (GstDashDemuxStream *) stream;
guint i;
guint32 track_id = 0;
guint64 prev_traf_end;
gboolean trex_sample_flags = FALSE;
- if (!dash_stream->moof)
+ if (!dash_stream->moof) {
+ dashdemux->allow_trickmode_key_units = FALSE;
return FALSE;
+ }
dash_stream->current_sync_sample = -1;
dash_stream->moof_sync_samples =
traf->tfhd.track_id);
g_array_free (dash_stream->moof_sync_samples, TRUE);
dash_stream->moof_sync_samples = NULL;
+ dashdemux->allow_trickmode_key_units = FALSE;
return FALSE;
}
"Sample size given by trex - can't download only keyframes");
g_array_free (dash_stream->moof_sync_samples, TRUE);
dash_stream->moof_sync_samples = NULL;
+ dashdemux->allow_trickmode_key_units = FALSE;
return FALSE;
}
"Sample flags given by trex - can't download only keyframes");
g_array_free (dash_stream->moof_sync_samples, TRUE);
dash_stream->moof_sync_samples = NULL;
+ dashdemux->allow_trickmode_key_units = FALSE;
return FALSE;
}
}
guint index_header_or_data;
if (!gst_mpd_client_has_isoff_ondemand_profile (dashdemux->client)) {
- if (dash_stream->is_isobmff) {
+ if (dash_stream->is_isobmff && dashdemux->allow_trickmode_key_units) {
if (dash_stream->isobmff_parser.current_fourcc != GST_ISOFF_FOURCC_MDAT) {
buffer = gst_dash_demux_parse_isobmff (demux, dash_stream, buffer);
GST_BUFFER_OFFSET (buffer) + gst_buffer_get_size (buffer);
dash_stream->sidx_current_offset = GST_BUFFER_OFFSET_END (buffer);
- if (dash_stream->is_isobmff) {
+ if (dash_stream->is_isobmff && dashdemux->allow_trickmode_key_units) {
if (dash_stream->isobmff_parser.current_fourcc != GST_ISOFF_FOURCC_MDAT) {
buffer = gst_dash_demux_parse_isobmff (demux, dash_stream, buffer);
GST_BUFFER_OFFSET (buffer) + gst_buffer_get_size (buffer);
dash_stream->sidx_current_offset = GST_BUFFER_OFFSET_END (buffer);
- if (dash_stream->is_isobmff) {
+ if (dash_stream->is_isobmff && dashdemux->allow_trickmode_key_units) {
if (dash_stream->isobmff_parser.current_fourcc != GST_ISOFF_FOURCC_MDAT) {
buffer = gst_dash_demux_parse_isobmff (demux, dash_stream, buffer);