/* *INDENT-ON* */
+/* FIXME: sof-marker is for IJG libjpeg 8, should be different for 6.2 */
static GstStaticPadTemplate gst_jpeg_dec_sink_pad_template =
GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_STATIC_CAPS ("image/jpeg, "
"width = (int) [ " G_STRINGIFY (MIN_WIDTH) ", " G_STRINGIFY (MAX_WIDTH)
" ], " "height = (int) [ " G_STRINGIFY (MIN_HEIGHT) ", "
- G_STRINGIFY (MAX_HEIGHT) " ], " "framerate = (fraction) [ 0/1, MAX ]")
+ G_STRINGIFY (MAX_HEIGHT) " ], framerate = (fraction) [ 0/1, MAX ], "
+ "sof-marker = (int) { 0, 1, 2, 5, 6, 7, 9, 10, 13, 14 }")
);
GST_DEBUG_CATEGORY_STATIC (jpeg_dec_debug);
/* get the index of the sample with media time */
index = gst_qtdemux_find_index_linear (qtdemux, str, media_start);
- GST_DEBUG_OBJECT (qtdemux, "sample for %" GST_TIME_FORMAT " at %u",
- GST_TIME_ARGS (media_start), index);
+ GST_DEBUG_OBJECT (qtdemux, "sample for %" GST_TIME_FORMAT " at %u"
+ " at offset %" G_GUINT64_FORMAT,
+ GST_TIME_ARGS (media_start), index, str->samples[index].offset);
/* find previous keyframe */
kindex = gst_qtdemux_find_keyframe (qtdemux, str, index);
media_time =
gst_util_uint64_scale (str->samples[kindex].timestamp, GST_SECOND,
str->timescale);
- GST_DEBUG_OBJECT (qtdemux, "keyframe at %u with time %" GST_TIME_FORMAT,
- kindex, GST_TIME_ARGS (media_time));
+ GST_DEBUG_OBJECT (qtdemux, "keyframe at %u with time %" GST_TIME_FORMAT
+ " at offset %" G_GUINT64_FORMAT,
+ kindex, GST_TIME_ARGS (media_time), str->samples[kindex].offset);
/* keyframes in the segment get a chance to change the
* desired_offset. keyframes out of the segment are
gint64 cur, stop;
GstMatroskaTrackContext *track = NULL;
GstSegment seeksegment = { 0, };
- gboolean update;
+ gboolean update = TRUE;
if (pad)
track = gst_pad_get_element_private (pad);
}
}
+ flush = !!(flags & GST_SEEK_FLAG_FLUSH);
+ keyunit = !!(flags & GST_SEEK_FLAG_KEY_UNIT);
+
GST_DEBUG_OBJECT (demux, "New segment %" GST_SEGMENT_FORMAT, &seeksegment);
+ if (!update) {
+ /* only have to update some segment,
+ * but also still have to honour flush and so on */
+ GST_DEBUG_OBJECT (demux, "... no update");
+ /* bad goto, bad ... */
+ goto next;
+ }
+
/* check sanity before we start flushing and all that */
GST_OBJECT_LOCK (demux);
track = gst_matroska_read_common_get_seek_track (&demux->common, track);
entry->pos + demux->common.ebml_segment_start);
}
- flush = ! !(flags & GST_SEEK_FLAG_FLUSH);
- keyunit = ! !(flags & GST_SEEK_FLAG_KEY_UNIT);
-
+next:
if (flush) {
GST_DEBUG_OBJECT (demux, "Starting flush");
gst_pad_push_event (demux->common.sinkpad, gst_event_new_flush_start ());
GST_DEBUG_OBJECT (demux, "Non-flushing seek, pausing task");
gst_pad_pause_task (demux->common.sinkpad);
}
+ /* ouch */
+ if (!update)
+ goto exit;
/* now grab the stream lock so that streaming cannot continue, for
* non flushing seeks when the element is in PAUSED this could block
seeksegment.time = entry->time - demux->stream_start_time;
}
+exit:
if (flush) {
GST_DEBUG_OBJECT (demux, "Stopping flush");
gst_pad_push_event (demux->common.sinkpad, gst_event_new_flush_stop ());
gst_matroska_demux_send_event (demux, gst_event_new_flush_stop ());
- } else if (demux->segment_running) {
+ } else if (demux->segment_running && update) {
GST_DEBUG_OBJECT (demux, "Closing currently running segment");
GST_OBJECT_LOCK (demux);
GST_OBJECT_UNLOCK (demux);
/* update some (segment) state */
- if (!gst_matroska_demux_move_to_entry (demux, entry, TRUE))
+ if (update && !gst_matroska_demux_move_to_entry (demux, entry, TRUE))
goto seek_error;
/* notify start of new segment */
GST_OBJECT_LOCK (demux);
if (demux->new_segment)
gst_event_unref (demux->new_segment);
- demux->new_segment = gst_event_new_new_segment_full (FALSE,
+ demux->new_segment = gst_event_new_new_segment_full (!update,
demux->common.segment.rate, demux->common.segment.applied_rate,
demux->common.segment.format, demux->common.segment.start,
demux->common.segment.stop, demux->common.segment.time);