resindvd: Use gst_base_src_new_seamless_segment()

When switching to a new seamless segment, use the new
gst_base_src_new_seamless_segment() function, because elements can't
send themselves seek events from the streaming thread.
This commit is contained in:
Jan Schmidt 2009-11-01 23:17:02 +01:00
parent d0e4331648
commit bc331df7f5

View file

@ -1310,23 +1310,30 @@ rsn_dvdsrc_create (RsnBaseSrc * bsrc, guint64 offset,
if (src->need_segment) { if (src->need_segment) {
/* Seamless segment update */ /* Seamless segment update */
GstEvent *seek; GstClockTime position = 0;
g_print ("Starting seamless segment update to %" GST_TIME_FORMAT " -> %" if (src->cur_position != GST_CLOCK_TIME_NONE)
GST_TIME_FORMAT " VOBU %" GST_TIME_FORMAT "\n", position += src->cur_position;
if (src->cur_vobu_base_ts != GST_CLOCK_TIME_NONE)
position += src->cur_vobu_base_ts;
GST_DEBUG_OBJECT (src,
"Starting seamless segment update to %" GST_TIME_FORMAT " -> %"
GST_TIME_FORMAT " VOBU %" GST_TIME_FORMAT " position %" GST_TIME_FORMAT,
GST_TIME_ARGS (src->cur_start_ts), GST_TIME_ARGS (src->cur_end_ts), GST_TIME_ARGS (src->cur_start_ts), GST_TIME_ARGS (src->cur_end_ts),
GST_TIME_ARGS (src->cur_vobu_base_ts)); GST_TIME_ARGS (src->cur_vobu_base_ts), GST_TIME_ARGS (position));
seek = gst_event_new_seek (segment->rate, rsndvd_format,
GST_SEEK_FLAG_NONE, GST_SEEK_TYPE_NONE, -1, GST_SEEK_TYPE_NONE, -1); gst_base_src_new_seamless_segment (RSN_BASE_SRC (src),
gst_element_send_event (GST_ELEMENT (src), seek); src->cur_start_ts, -1, position);
src->need_segment = FALSE; src->need_segment = FALSE;
} }
g_mutex_lock (src->dvd_lock);
if (src->cur_end_ts != GST_CLOCK_TIME_NONE) if (src->cur_end_ts != GST_CLOCK_TIME_NONE)
gst_segment_set_last_stop (segment, GST_FORMAT_TIME, src->cur_end_ts); gst_segment_set_last_stop (segment, GST_FORMAT_TIME, src->cur_end_ts);
g_mutex_lock (src->dvd_lock);
if (src->next_buf != NULL) { if (src->next_buf != NULL) {
/* Now that we're in the new segment, we can enqueue any nav packet /* Now that we're in the new segment, we can enqueue any nav packet
* correctly */ * correctly */