Don't take stream lock.

Original commit message from CVS:
2005-11-21  Andy Wingo  <wingo@pobox.com>

* ext/vorbis/vorbisdec.c (vorbis_dec_sink_event):
* gst/videorate/gstvideorate.c (gst_videorate_event):
* ext/theora/theoradec.c (theora_dec_sink_event):
* ext/theora/theoraenc.c (theora_enc_sink_event): Don't take
stream lock.

* gst/subparse/gstsubparse.c (gst_subparse_src_event):
* ext/ogg/gstoggdemux.c (gst_ogg_demux_perform_seek): Update for
stream lock changes.
This commit is contained in:
Andy Wingo 2005-11-21 17:29:00 +00:00
parent 0f2336cff6
commit 137c23468e
8 changed files with 18 additions and 27 deletions

View file

@ -1,3 +1,15 @@
2005-11-21 Andy Wingo <wingo@pobox.com>
* ext/vorbis/vorbisdec.c (vorbis_dec_sink_event):
* gst/videorate/gstvideorate.c (gst_videorate_event):
* ext/theora/theoradec.c (theora_dec_sink_event):
* ext/theora/theoraenc.c (theora_enc_sink_event): Don't take
stream lock.
* gst/subparse/gstsubparse.c (gst_subparse_src_event):
* ext/ogg/gstoggdemux.c (gst_ogg_demux_perform_seek): Update for
stream lock changes.
2005-11-21 Wim Taymans <wim@fluendo.com>
* gst-libs/gst/audio/gstbaseaudiosink.c:

View file

@ -1574,7 +1574,7 @@ gst_ogg_demux_perform_seek (GstOggDemux * ogg)
/* now grab the stream lock so that streaming cannot continue, for
* non flushing seeks when the element is in PAUSED this could block
* forever. */
GST_STREAM_LOCK (ogg->sinkpad);
GST_PAD_STREAM_LOCK (ogg->sinkpad);
GST_OBJECT_LOCK (ogg);
/* nothing configured, play complete file */
@ -1786,21 +1786,21 @@ gst_ogg_demux_perform_seek (GstOggDemux * ogg)
}
/* streaming can continue now */
GST_STREAM_UNLOCK (ogg->sinkpad);
GST_PAD_STREAM_UNLOCK (ogg->sinkpad);
return TRUE;
no_chains:
{
GST_DEBUG_OBJECT (ogg, "no chains");
GST_STREAM_UNLOCK (ogg->sinkpad);
GST_PAD_STREAM_UNLOCK (ogg->sinkpad);
return FALSE;
}
seek_error:
{
GST_DEBUG_OBJECT (ogg, "got a seek error");
GST_STREAM_UNLOCK (ogg->sinkpad);
GST_PAD_STREAM_UNLOCK (ogg->sinkpad);
return FALSE;
}

View file

@ -599,9 +599,7 @@ theora_dec_sink_event (GstPad * pad, GstEvent * event)
GST_LOG_OBJECT (dec, "handling event");
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_EOS:
GST_STREAM_LOCK (pad);
ret = gst_pad_push_event (dec->srcpad, event);
GST_STREAM_UNLOCK (pad);
break;
case GST_EVENT_NEWSEGMENT:
{
@ -609,7 +607,6 @@ theora_dec_sink_event (GstPad * pad, GstEvent * event)
gdouble rate;
gint64 start, stop, time;
GST_STREAM_LOCK (pad);
gst_event_parse_newsegment (event, NULL, &rate, &format, &start, &stop,
&time);
@ -630,7 +627,6 @@ theora_dec_sink_event (GstPad * pad, GstEvent * event)
dec->granulepos = -1;
dec->last_timestamp = -1;
ret = gst_pad_push_event (dec->srcpad, event);
GST_STREAM_UNLOCK (pad);
break;
}
default:
@ -645,13 +641,11 @@ done:
/* ERRORS */
newseg_wrong_format:
{
GST_STREAM_UNLOCK (pad);
GST_DEBUG ("received non TIME newsegment");
goto done;
}
newseg_wrong_rate:
{
GST_STREAM_UNLOCK (pad);
GST_DEBUG ("negative rates not supported yet");
goto done;
}

View file

@ -423,7 +423,6 @@ theora_enc_sink_event (GstPad * pad, GstEvent * event)
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_EOS:
GST_STREAM_LOCK (pad);
/* push last packet with eos flag */
while (theora_encode_packetout (&enc->state, 1, &op)) {
GstClockTime out_time =
@ -432,7 +431,6 @@ theora_enc_sink_event (GstPad * pad, GstEvent * event)
theora_push_packet (enc, &op, out_time, GST_SECOND / enc->fps);
}
res = gst_pad_push_event (enc->srcpad, event);
GST_STREAM_UNLOCK (pad);
break;
default:
res = gst_pad_push_event (enc->srcpad, event);

View file

@ -428,9 +428,7 @@ vorbis_dec_sink_event (GstPad * pad, GstEvent * event)
GST_LOG_OBJECT (dec, "handling event");
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_EOS:
GST_STREAM_LOCK (pad);
ret = gst_pad_push_event (dec->srcpad, event);
GST_STREAM_UNLOCK (pad);
break;
case GST_EVENT_NEWSEGMENT:
{
@ -439,7 +437,6 @@ vorbis_dec_sink_event (GstPad * pad, GstEvent * event)
gint64 start, stop, time;
gboolean update;
GST_STREAM_LOCK (pad);
gst_event_parse_newsegment (event, &update, &rate, &format, &start, &stop,
&time);
@ -463,7 +460,6 @@ vorbis_dec_sink_event (GstPad * pad, GstEvent * event)
vorbis_synthesis_restart (&dec->vd);
#endif
ret = gst_pad_push_event (dec->srcpad, event);
GST_STREAM_UNLOCK (pad);
break;
}
default:
@ -477,13 +473,11 @@ done:
/* ERRORS */
newseg_wrong_format:
{
GST_STREAM_UNLOCK (pad);
GST_DEBUG ("received non TIME newsegment");
goto done;
}
newseg_wrong_rate:
{
GST_STREAM_UNLOCK (pad);
GST_DEBUG ("negative rates not supported yet");
goto done;
}

View file

@ -884,17 +884,14 @@ gst_vorbisenc_sink_event (GstPad * pad, GstEvent * event)
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_EOS:
GST_STREAM_LOCK (pad);
/* Tell the library we're at end of stream so that it can handle
* the last frame and mark end of stream in the output properly */
GST_DEBUG_OBJECT (vorbisenc, "EOS, clearing state and sending event on");
gst_vorbisenc_clear (vorbisenc);
res = gst_pad_push_event (vorbisenc->srcpad, event);
GST_STREAM_UNLOCK (pad);
break;
case GST_EVENT_TAG:
GST_STREAM_LOCK (pad);
if (vorbisenc->tags) {
GstTagList *list;
@ -905,7 +902,6 @@ gst_vorbisenc_sink_event (GstPad * pad, GstEvent * event)
g_assert_not_reached ();
}
res = gst_pad_push_event (vorbisenc->srcpad, event);
GST_STREAM_UNLOCK (pad);
break;
default:
res = gst_pad_push_event (vorbisenc->srcpad, event);

View file

@ -184,13 +184,13 @@ gst_subparse_src_event (GstPad * pad, GstEvent * event)
gst_event_unref (event);
GST_STREAM_LOCK (self->sinkpad);
GST_PAD_STREAM_LOCK (self->sinkpad);
/* just seek to 0, rely on the overlayer to throw away buffers until the right
time -- and his mother cried... */
self->next_offset = 0;
GST_STREAM_UNLOCK (self->sinkpad);
GST_PAD_STREAM_UNLOCK (self->sinkpad);
gst_object_unref (self);

View file

@ -394,8 +394,6 @@ gst_videorate_event (GstPad * pad, GstEvent * event)
gboolean update;
GstFormat format;
GST_STREAM_LOCK (pad);
gst_event_parse_newsegment (event, &update, &rate, &format, &start, &stop,
&base);
@ -415,7 +413,6 @@ gst_videorate_event (GstPad * pad, GstEvent * event)
GST_TIME_ARGS (videorate->segment_start),
GST_TIME_ARGS (videorate->segment_stop));
}
GST_STREAM_UNLOCK (pad);
break;
}