mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
gst/qtdemux/qtdemux.*: Queue up new segment events instead of sending them from the seeking thread.
Original commit message from CVS: * gst/qtdemux/qtdemux.h (struct _GstQTDemux): * gst/qtdemux/qtdemux.c (gst_qtdemux_do_seek): Queue up new segment events instead of sending them from the seeking thread. Fixes #559288. (gst_qtdemux_push_pending_newsegment): New helper, sends out queued newsegment events. (gst_qtdemux_loop_state_movie): Voilà, call it here. Only need to call it here, as we only seek when looping, and only push in the movie state.
This commit is contained in:
parent
03ab3610c7
commit
c71fe3f75d
3 changed files with 34 additions and 11 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
||||||
|
2008-11-12 Andy Wingo <wingo@pobox.com>
|
||||||
|
|
||||||
|
* gst/qtdemux/qtdemux.h (struct _GstQTDemux):
|
||||||
|
* gst/qtdemux/qtdemux.c (gst_qtdemux_do_seek): Queue up new
|
||||||
|
segment events instead of sending them from the seeking thread.
|
||||||
|
Fixes #559288.
|
||||||
|
(gst_qtdemux_push_pending_newsegment): New helper, sends out
|
||||||
|
queued newsegment events.
|
||||||
|
(gst_qtdemux_loop_state_movie): Voilà, call it here. Only need to
|
||||||
|
call it here, as we only seek when looping, and only push in the
|
||||||
|
movie state.
|
||||||
|
|
||||||
2008-11-11 Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
|
2008-11-11 Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
|
||||||
|
|
||||||
* gst/qtdemux/qtdemux.c: (qtdemux_tag_add_tmpo),
|
* gst/qtdemux/qtdemux.c: (qtdemux_tag_add_tmpo),
|
||||||
|
|
|
@ -554,6 +554,16 @@ gst_qtdemux_push_event (GstQTDemux * qtdemux, GstEvent * event)
|
||||||
gst_event_unref (event);
|
gst_event_unref (event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* push a pending newsegment event, if any from the streaming thread */
|
||||||
|
static void
|
||||||
|
gst_qtdemux_push_pending_newsegment (GstQTDemux * qtdemux)
|
||||||
|
{
|
||||||
|
if (qtdemux->pending_newsegment) {
|
||||||
|
gst_qtdemux_push_event (qtdemux, qtdemux->pending_newsegment);
|
||||||
|
qtdemux->pending_newsegment = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* find the index of the sample that includes the data for @media_time
|
/* find the index of the sample that includes the data for @media_time
|
||||||
*
|
*
|
||||||
* Returns the index of the sample or n_samples when the sample was not
|
* Returns the index of the sample or n_samples when the sample was not
|
||||||
|
@ -884,23 +894,21 @@ gst_qtdemux_do_seek (GstQTDemux * qtdemux, GstPad * pad, GstEvent * event)
|
||||||
qtdemux->segment.last_stop);
|
qtdemux->segment.last_stop);
|
||||||
|
|
||||||
if (qtdemux->segment.rate >= 0) {
|
if (qtdemux->segment.rate >= 0) {
|
||||||
/* FIXME, needs to be done from the streaming thread. Also, the rate is the
|
/* FIXME, rate is the product of the global rate and the (quicktime)
|
||||||
* product of the global rate and the (quicktime) segment rate. */
|
* segment rate. */
|
||||||
gst_qtdemux_push_event (qtdemux,
|
qtdemux->pending_newsegment = gst_event_new_new_segment (TRUE,
|
||||||
gst_event_new_new_segment (TRUE,
|
qtdemux->segment.rate, qtdemux->segment.format,
|
||||||
qtdemux->segment.rate, qtdemux->segment.format,
|
qtdemux->segment.start, qtdemux->segment.last_stop,
|
||||||
qtdemux->segment.start, qtdemux->segment.last_stop,
|
qtdemux->segment.time);
|
||||||
qtdemux->segment.time));
|
|
||||||
} else { /* For Reverse Playback */
|
} else { /* For Reverse Playback */
|
||||||
guint64 stop;
|
guint64 stop;
|
||||||
|
|
||||||
if ((stop = qtdemux->segment.stop) == -1)
|
if ((stop = qtdemux->segment.stop) == -1)
|
||||||
stop = qtdemux->segment.duration;
|
stop = qtdemux->segment.duration;
|
||||||
/* for reverse playback, we played from stop to last_stop. */
|
/* for reverse playback, we played from stop to last_stop. */
|
||||||
gst_qtdemux_push_event (qtdemux,
|
qtdemux->pending_newsegment = gst_event_new_new_segment (TRUE,
|
||||||
gst_event_new_new_segment (TRUE,
|
qtdemux->segment.rate, qtdemux->segment.format,
|
||||||
qtdemux->segment.rate, qtdemux->segment.format,
|
qtdemux->segment.last_stop, stop, qtdemux->segment.last_stop);
|
||||||
qtdemux->segment.last_stop, stop, qtdemux->segment.last_stop));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1764,6 +1772,8 @@ gst_qtdemux_loop_state_movie (GstQTDemux * qtdemux)
|
||||||
gint index;
|
gint index;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
|
gst_qtdemux_push_pending_newsegment (qtdemux);
|
||||||
|
|
||||||
/* Figure out the next stream sample to output, min_time is expressed in
|
/* Figure out the next stream sample to output, min_time is expressed in
|
||||||
* global time and runs over the edit list segments. */
|
* global time and runs over the edit list segments. */
|
||||||
min_time = G_MAXUINT64;
|
min_time = G_MAXUINT64;
|
||||||
|
|
|
@ -89,6 +89,7 @@ struct _GstQTDemux {
|
||||||
/* configured playback region */
|
/* configured playback region */
|
||||||
GstSegment segment;
|
GstSegment segment;
|
||||||
gboolean segment_running;
|
gboolean segment_running;
|
||||||
|
GstEvent *pending_newsegment;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstQTDemuxClass {
|
struct _GstQTDemuxClass {
|
||||||
|
|
Loading…
Reference in a new issue