demux->cached_length = G_MAXUINT64;
+ if (demux->deferred_seek_event)
+ gst_event_unref (demux->deferred_seek_event);
+ demux->deferred_seek_event = NULL;
+ demux->deferred_seek_pad = NULL;
+
gst_flow_combiner_clear (demux->flowcombiner);
}
if (GST_EVENT_TYPE (event) == GST_EVENT_SEEK) {
/* no seeking until we are (safely) ready */
if (demux->common.state != GST_MATROSKA_READ_STATE_DATA) {
- GST_DEBUG_OBJECT (demux, "not ready for seeking yet");
- gst_event_unref (event);
- return FALSE;
+ GST_DEBUG_OBJECT (demux,
+ "not ready for seeking yet, deferring seek: %" GST_PTR_FORMAT, event);
+ if (demux->deferred_seek_event)
+ gst_event_unref (demux->deferred_seek_event);
+ demux->deferred_seek_event = event;
+ demux->deferred_seek_pad = NULL;
+ return TRUE;
}
res = gst_matroska_demux_handle_seek_event (demux, NULL, event);
} else {
* would be determined again when parsing, but anyway ... */
seeksegment.duration = demux->common.segment.duration;
- flush = !!(flags & GST_SEEK_FLAG_FLUSH);
- keyunit = !!(flags & GST_SEEK_FLAG_KEY_UNIT);
- after = !!(flags & GST_SEEK_FLAG_SNAP_AFTER);
- before = !!(flags & GST_SEEK_FLAG_SNAP_BEFORE);
+ flush = ! !(flags & GST_SEEK_FLAG_FLUSH);
+ keyunit = ! !(flags & GST_SEEK_FLAG_KEY_UNIT);
+ after = ! !(flags & GST_SEEK_FLAG_SNAP_AFTER);
+ before = ! !(flags & GST_SEEK_FLAG_SNAP_BEFORE);
/* always do full update if flushing,
* otherwise problems might arise downstream with missing keyframes etc */
case GST_EVENT_SEEK:
/* no seeking until we are (safely) ready */
if (demux->common.state != GST_MATROSKA_READ_STATE_DATA) {
- GST_DEBUG_OBJECT (demux, "not ready for seeking yet");
- gst_event_unref (event);
- return FALSE;
+ GST_DEBUG_OBJECT (demux,
+ "not ready for seeking yet, deferring seek event: %" GST_PTR_FORMAT,
+ event);
+ if (demux->deferred_seek_event)
+ gst_event_unref (demux->deferred_seek_event);
+ demux->deferred_seek_event = event;
+ demux->deferred_seek_pad = pad;
+ return TRUE;
}
{
GST_DEBUG_OBJECT (demux,
"estimated duration as %" GST_TIME_FORMAT,
GST_TIME_ARGS (demux->common.segment.duration));
+
+ g_free (last);
}
}
demux->common.offset = demux->first_cluster_offset;
}
+ if (demux->deferred_seek_event) {
+ GstEvent *seek_event;
+ GstPad *seek_pad;
+ seek_event = demux->deferred_seek_event;
+ seek_pad = demux->deferred_seek_pad;
+ demux->deferred_seek_event = NULL;
+ demux->deferred_seek_pad = NULL;
+ GST_DEBUG_OBJECT (demux,
+ "Handling deferred seek event: %" GST_PTR_FORMAT, seek_event);
+ gst_matroska_demux_handle_seek_event (demux, seek_pad,
+ seek_event);
+ gst_event_unref (seek_event);
+ }
+
/* send initial segment - we wait till we know the first
incoming timestamp, so we can properly set the start of
the segment. */
static GstStaticCaps intra_caps = GST_STATIC_CAPS ("image/jpeg; "
"video/x-raw; image/png; video/x-dv; video/x-huffyuv; video/x-ffv; "
"video/x-compressed-yuv");
+ GstCaps *tmp = gst_static_caps_get (&intra_caps);
+
context->intra_only =
- gst_caps_can_intersect (gst_static_caps_get (&intra_caps), caps);
+ gst_caps_can_intersect (tmp, caps);
+ gst_caps_unref(tmp);
}
if (buf)
gst_caps_set_simple (caps, "codec_data", GST_TYPE_BUFFER, priv, NULL);
gst_buffer_unref (priv);
} else {
- GST_WARNING ("No codec data found, assuming output is byte-stream");
- gst_caps_set_simple (caps, "stream-format", G_TYPE_STRING, "byte-stream",
- NULL);
+ GST_WARNING ("No AV1 codec data found!");
}
*codec_name = g_strdup_printf ("AOM AV1");
} else if (!strcmp (codec_id, GST_MATROSKA_CODEC_ID_VIDEO_PRORES)) {
*riff_audio_fmt = auds.format;
/* FIXME: Handle reorder map */
- caps = gst_riff_create_audio_caps (auds.format, NULL, &auds, NULL,
- codec_data, codec_name, NULL);
+ caps = gst_riff_create_audio_caps (auds.format, NULL, &auds, codec_data,
+ NULL, codec_name, NULL);
if (codec_data)
gst_buffer_unref (codec_data);