Commit 1aca0c54 authored by Wim Taymans's avatar Wim Taymans

ext/flac/: Spifify a bit.

Original commit message from CVS:
* ext/flac/gstflacdec.c: (gst_flac_dec_handle_seek_event):
* ext/flac/gstflacdec.h:
* ext/flac/gstflacenc.h:
Spifify a bit.
Fix deadly lock order error in seeking code, STREAM_LOCK
cannot be taken within LOCK and the streaming variables are
protected with the STREAM_LOCK anyway.
parent aa23e235
2006-03-24 Wim Taymans <wim@fluendo.com>
* ext/flac/gstflacdec.c: (gst_flac_dec_handle_seek_event):
* ext/flac/gstflacdec.h:
* ext/flac/gstflacenc.h:
Spifify a bit.
Fix deadly lock order error in seeking code, STREAM_LOCK
cannot be taken within LOCK and the streaming variables are
protected with the STREAM_LOCK anyway.
2006-03-24 Wim Taymans <wim@fluendo.com>
* gst/avi/gstavidemux.c: (gst_avi_demux_parse_index),
......
......@@ -920,14 +920,6 @@ gst_flac_dec_handle_seek_event (GstFlacDec * flacdec, GstEvent * event)
flush = ((seek_flags & GST_SEEK_FLAG_FLUSH) == GST_SEEK_FLAG_FLUSH);
GST_OBJECT_LOCK (flacdec);
/* operate on segment copy until we know the seek worked */
segment = flacdec->segment;
gst_segment_set_seek (&segment, rate, GST_FORMAT_DEFAULT,
seek_flags, start_type, start, stop_type, stop, &only_update);
if (flush) {
gst_pad_push_event (flacdec->srcpad, gst_event_new_flush_start ());
} else {
......@@ -936,13 +928,11 @@ gst_flac_dec_handle_seek_event (GstFlacDec * flacdec, GstEvent * event)
GST_PAD_STREAM_LOCK (flacdec->sinkpad);
#if 0
if (only_update) {
flacdec->segment = segment;
gst_flac_dec_send_newsegment (flacdec, TRUE);
goto done;
}
#endif
/* operate on segment copy until we know the seek worked */
segment = flacdec->segment;
gst_segment_set_seek (&segment, rate, GST_FORMAT_DEFAULT,
seek_flags, start_type, start, stop_type, stop, &only_update);
GST_DEBUG ("configured segment: [%" G_GINT64_FORMAT "-%" G_GINT64_FORMAT
"] = [%" GST_TIME_FORMAT "-%" GST_TIME_FORMAT "]",
......@@ -960,38 +950,25 @@ gst_flac_dec_handle_seek_event (GstFlacDec * flacdec, GstEvent * event)
flacdec->seeking = FALSE;
gst_pad_push_event (flacdec->srcpad, gst_event_new_flush_stop ());
/* FIXME: support segment seeks */
if (flush) {
gst_pad_push_event (flacdec->srcpad, gst_event_new_flush_stop ());
}
if (seek_ok) {
flacdec->segment = segment;
gst_flac_dec_send_newsegment (flacdec, FALSE);
flacdec->segment.last_stop = segment.start;
/* FIXME: support segment seeks
if ((seek_flags & GST_SEEK_FLAG_SEGMENT) != 0) {
GST_DEBUG_OBJECT (flacdec, "posting SEGMENT_START message");
GST_OBJECT_UNLOCK (flacdec);
gst_element_post_message (GST_ELEMENT (flacdec),
gst_message_new_segment_start (GST_OBJECT (flacdec),
GST_FORMAT_DEFAULT, flacdec->segment.start));
GST_OBJECT_LOCK (flacdec);
}
*/
GST_DEBUG_OBJECT (flacdec, "seek successful");
} else {
GST_WARNING_OBJECT (flacdec, "seek failed");
}
#if 0
done:
#endif
GST_PAD_STREAM_UNLOCK (flacdec->sinkpad);
gst_pad_start_task (flacdec->sinkpad,
(GstTaskFunction) gst_flac_dec_loop, flacdec->sinkpad);
GST_OBJECT_UNLOCK (flacdec);
GST_PAD_STREAM_UNLOCK (flacdec->sinkpad);
return TRUE;
}
......
......@@ -26,10 +26,7 @@
#include <FLAC/all.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
G_BEGIN_DECLS
#define GST_TYPE_FLAC_DEC gst_flac_dec_get_type()
#define GST_FLAC_DEC(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, GST_TYPE_FLAC_DEC, GstFlacDec)
......@@ -75,9 +72,6 @@ struct _GstFlacDecClass {
GType gst_flac_dec_get_type (void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
G_END_DECLS
#endif /* __GST_FLAC_DEC_H__ */
......@@ -27,7 +27,6 @@
G_BEGIN_DECLS
#define GST_TYPE_FLAC_ENC (gst_flac_enc_get_type())
#define GST_FLAC_ENC(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, GST_TYPE_FLAC_ENC, GstFlacEnc)
#define GST_FLAC_ENC_CLASS(klass) G_TYPE_CHECK_CLASS_CAST(klass, GST_TYPE_FLAC_ENC, GstFlacEnc)
......@@ -67,8 +66,6 @@ struct _GstFlacEncClass {
GType gst_flac_enc_get_type(void);
G_END_DECLS
#endif /* __GST_FLAC_ENC_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment