summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>2005-08-09 12:33:21 +0000
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>2005-08-09 12:33:21 +0000
commit139e82bd8b898defc6b9aab346f55195cb462463 (patch)
treef5c81686880c8cd77d1388fc9c0e945d47631cdc
parent0d1f52616a6ad52986b5247ff94f071ebb23e925 (diff)
gst/avi/gstavidemux.c: Fix seeking (or, well, fix threading issue where a variable was set before a lock was taken an...
Original commit message from CVS: * gst/avi/gstavidemux.c: (gst_avi_demux_handle_src_event), (gst_avi_demux_handle_seek): Fix seeking (or, well, fix threading issue where a variable was set before a lock was taken and was already unset before that same lock was taken and was thus no longer in existance when it actually had to be used).
-rw-r--r--ChangeLog9
-rw-r--r--gst/avi/gstavidemux.c10
2 files changed, 14 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 541aefb2..0ad1d401 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2005-08-09 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
+ * gst/avi/gstavidemux.c: (gst_avi_demux_handle_src_event),
+ (gst_avi_demux_handle_seek):
+ Fix seeking (or, well, fix threading issue where a variable was
+ set before a lock was taken and was already unset before that
+ same lock was taken and was thus no longer in existance when it
+ actually had to be used).
+
+2005-08-09 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
+
* gst/avi/gstavidemux.c: (gst_avi_demux_process_next_entry):
Mixing binary and logical operators is not going to work; fix
position-querying in Totem.
diff --git a/gst/avi/gstavidemux.c b/gst/avi/gstavidemux.c
index b37d0d73..fcf28c34 100644
--- a/gst/avi/gstavidemux.c
+++ b/gst/avi/gstavidemux.c
@@ -59,7 +59,7 @@ static gboolean gst_avi_demux_src_convert (GstPad * pad,
GstFormat src_format,
gint64 src_value, GstFormat * dest_format, gint64 * dest_value);
-static gboolean gst_avi_demux_handle_seek (GstAviDemux * avi);
+static gboolean gst_avi_demux_handle_seek (GstAviDemux * avi, guint64 time);
static void gst_avi_demux_loop (GstPad * pad);
static gboolean gst_avi_demux_sink_activate (GstPad * sinkpad);
static gboolean gst_avi_demux_sink_activate_pull (GstPad * sinkpad,
@@ -516,7 +516,7 @@ gst_avi_demux_handle_src_event (GstPad * pad, GstEvent * event)
avi->seek_flush = flags & GST_SEEK_FLAG_FLUSH;
avi->seek_entry = entry->index_nr;
GST_DEBUG_OBJECT (avi, "Will seek to entry %d", avi->seek_entry);
- res = gst_avi_demux_handle_seek (avi);
+ res = gst_avi_demux_handle_seek (avi, real->ts);
} else {
GST_DEBUG_OBJECT (avi, "no index entry found for format=%d value=%"
G_GINT64_FORMAT, format, desired_offset);
@@ -1942,7 +1942,7 @@ done:
*/
static gboolean
-gst_avi_demux_handle_seek (GstAviDemux * avi)
+gst_avi_demux_handle_seek (GstAviDemux * avi, guint64 time)
{
/* FIXME: if we seek in an openDML file, we will have multiple
* primary levels. Seeking in between those will cause havoc. */
@@ -1953,13 +1953,13 @@ gst_avi_demux_handle_seek (GstAviDemux * avi)
GST_STREAM_LOCK (avi->sinkpad);
+ avi->last_seek = time;
avi->current_entry = avi->seek_entry;
avi->seek_event = gst_event_new_newsegment (1.0,
- GST_FORMAT_TIME, avi->last_seek,
+ GST_FORMAT_TIME, time,
(gint64) (((gfloat) avi->stream[0].strh->scale) *
avi->stream[0].strh->length /
avi->stream[0].strh->rate) * GST_SECOND, 0);
-
gst_avi_demux_send_event (avi, gst_event_new_flush_stop ());
gst_pad_start_task (avi->sinkpad, (GstTaskFunction) gst_avi_demux_loop,