summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Schmidt <thaytan@noraisin.net>2009-11-01 23:17:02 +0100
committerJan Schmidt <thaytan@noraisin.net>2009-11-02 02:54:23 +0100
commitbc331df7f532bcbe83b4cda7b7f53c5d7864c98d (patch)
treeb56ea310047c8223cc31b113929836187905ce92
parentd0e4331648a4609d7a623166d151f44560836e82 (diff)
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.
-rw-r--r--ext/resindvd/resindvdsrc.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/ext/resindvd/resindvdsrc.c b/ext/resindvd/resindvdsrc.c
index 9c2e8fb40..b3bcdad39 100644
--- a/ext/resindvd/resindvdsrc.c
+++ b/ext/resindvd/resindvdsrc.c
@@ -1310,23 +1310,30 @@ rsn_dvdsrc_create (RsnBaseSrc * bsrc, guint64 offset,
if (src->need_segment) {
/* Seamless segment update */
- GstEvent *seek;
+ GstClockTime position = 0;
- g_print ("Starting seamless segment update to %" GST_TIME_FORMAT " -> %"
- GST_TIME_FORMAT " VOBU %" GST_TIME_FORMAT "\n",
+ if (src->cur_position != GST_CLOCK_TIME_NONE)
+ 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_vobu_base_ts));
- seek = gst_event_new_seek (segment->rate, rsndvd_format,
- GST_SEEK_FLAG_NONE, GST_SEEK_TYPE_NONE, -1, GST_SEEK_TYPE_NONE, -1);
- gst_element_send_event (GST_ELEMENT (src), seek);
+ GST_TIME_ARGS (src->cur_vobu_base_ts), GST_TIME_ARGS (position));
+
+ gst_base_src_new_seamless_segment (RSN_BASE_SRC (src),
+ src->cur_start_ts, -1, position);
+
src->need_segment = FALSE;
}
- g_mutex_lock (src->dvd_lock);
-
if (src->cur_end_ts != GST_CLOCK_TIME_NONE)
gst_segment_set_last_stop (segment, GST_FORMAT_TIME, src->cur_end_ts);
+ g_mutex_lock (src->dvd_lock);
+
if (src->next_buf != NULL) {
/* Now that we're in the new segment, we can enqueue any nav packet
* correctly */