current_sequence = file->sequence;
current_pos = 0;
target_pos = (GstClockTime) start;
+ /* FIXME: Here we need proper discont handling */
for (walk = demux->client->current->files; walk; walk = walk->next) {
file = walk->data;
buf = gst_fragment_get_buffer (fragment);
- if (G_UNLIKELY (!srccaps || !gst_caps_is_equal_fixed (bufcaps, srccaps))) {
+ if (G_UNLIKELY (!srccaps || demux->discont || GST_BUFFER_IS_DISCONT (buf))) {
switch_pads (demux, bufcaps);
demux->need_segment = TRUE;
+ demux->discont = FALSE;
+ GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DISCONT);
}
gst_caps_unref (bufcaps);
if (G_LIKELY (srccaps))
demux->position_shift = 0;
demux->need_segment = TRUE;
+ demux->discont = TRUE;
demux->have_group_id = FALSE;
demux->group_id = G_MAXUINT;
GST_INFO_OBJECT (demux, "Client was on %dbps, max allowed is %dbps, switching"
" to bitrate %dbps", old_bandwidth, max_bitrate, new_bandwidth);
+ demux->discont = TRUE;
if (gst_hls_demux_update_playlist (demux, FALSE, NULL)) {
GstStructure *s;
if (discont) {
GST_DEBUG_OBJECT (demux, "Marking fragment as discontinuous");
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DISCONT);
+ } else {
+ GST_BUFFER_FLAG_UNSET (buf, GST_BUFFER_FLAG_DISCONT);
}
/* The buffer ref is still kept inside the fragment download */
gint val;
GstClockTime duration;
gchar *title, *end;
-// gboolean discontinuity;
+ gboolean discontinuity = FALSE;
GstM3U8 *list;
gboolean have_iv = FALSE;
guint8 iv[16] = { 0, };
}
}
+ file->discont = discontinuity;
+
duration = 0;
title = NULL;
+ discontinuity = FALSE;
self->files = g_list_append (self->files, file);
}
if (int_from_string (data + 22, &data, &val))
self->mediasequence = val;
} else if (g_str_has_prefix (data, "#EXT-X-DISCONTINUITY")) {
- /* discontinuity = TRUE; */
+ discontinuity = TRUE;
} else if (g_str_has_prefix (data, "#EXT-X-PROGRAM-DATE-TIME:")) {
/* <YYYY-MM-DDThh:mm:ssZ> */
GST_DEBUG ("FIXME parse date");
*timestamp = client->sequence_position;
if (discontinuity)
- *discontinuity = client->sequence != file->sequence;
+ *discontinuity = client->sequence != file->sequence || file->discont;
if (uri)
*uri = file->uri;
if (duration)