mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 06:58:56 +00:00
No need to take the lock anymore, core already did that before calling us.
Original commit message from CVS: * ext/mad/gstmad.c: (gst_mad_chain), (gst_mad_change_state): * ext/sidplay/gstsiddec.cc: * gst/alpha/gstalpha.c: (gst_alpha_chain): * gst/goom/gstgoom.c: (gst_goom_chain): No need to take the lock anymore, core already did that before calling us.
This commit is contained in:
parent
0e06450bdf
commit
2a98869f30
3 changed files with 26 additions and 28 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2005-05-25 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
|
* ext/mad/gstmad.c: (gst_mad_chain), (gst_mad_change_state):
|
||||||
|
* ext/sidplay/gstsiddec.cc:
|
||||||
|
* gst/alpha/gstalpha.c: (gst_alpha_chain):
|
||||||
|
* gst/goom/gstgoom.c: (gst_goom_chain):
|
||||||
|
No need to take the lock anymore, core already did
|
||||||
|
that before calling us.
|
||||||
|
|
||||||
2005-05-25 Wim Taymans <wim@fluendo.com>
|
2005-05-25 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
* ext/amrnb/amrnbdec.c: (gst_amrnbdec_init), (gst_amrnbdec_chain),
|
* ext/amrnb/amrnbdec.c: (gst_amrnbdec_init), (gst_amrnbdec_chain),
|
||||||
|
|
|
@ -1283,8 +1283,6 @@ gst_mad_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
mad = GST_MAD (GST_PAD_PARENT (pad));
|
mad = GST_MAD (GST_PAD_PARENT (pad));
|
||||||
g_return_val_if_fail (GST_IS_MAD (mad), GST_FLOW_ERROR);
|
g_return_val_if_fail (GST_IS_MAD (mad), GST_FLOW_ERROR);
|
||||||
|
|
||||||
GST_STREAM_LOCK (pad);
|
|
||||||
|
|
||||||
/* restarts happen on discontinuities, ie. seek, flush, PAUSED to PLAYING */
|
/* restarts happen on discontinuities, ie. seek, flush, PAUSED to PLAYING */
|
||||||
if (gst_mad_check_restart (mad))
|
if (gst_mad_check_restart (mad))
|
||||||
GST_DEBUG ("mad restarted");
|
GST_DEBUG ("mad restarted");
|
||||||
|
@ -1591,7 +1589,6 @@ gst_mad_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
result = GST_FLOW_OK;
|
result = GST_FLOW_OK;
|
||||||
|
|
||||||
end:
|
end:
|
||||||
GST_STREAM_UNLOCK (pad);
|
|
||||||
gst_buffer_unref (buffer);
|
gst_buffer_unref (buffer);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -1601,10 +1598,13 @@ static GstElementStateReturn
|
||||||
gst_mad_change_state (GstElement * element)
|
gst_mad_change_state (GstElement * element)
|
||||||
{
|
{
|
||||||
GstMad *mad;
|
GstMad *mad;
|
||||||
|
GstElementStateReturn ret;
|
||||||
|
gint transition;
|
||||||
|
|
||||||
mad = GST_MAD (element);
|
mad = GST_MAD (element);
|
||||||
|
transition = GST_STATE_TRANSITION (element);
|
||||||
|
|
||||||
switch (GST_STATE_TRANSITION (element)) {
|
switch (transition) {
|
||||||
case GST_STATE_NULL_TO_READY:
|
case GST_STATE_NULL_TO_READY:
|
||||||
break;
|
break;
|
||||||
case GST_STATE_READY_TO_PAUSED:
|
case GST_STATE_READY_TO_PAUSED:
|
||||||
|
@ -1635,12 +1635,17 @@ gst_mad_change_state (GstElement * element)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GST_STATE_PAUSED_TO_PLAYING:
|
case GST_STATE_PAUSED_TO_PLAYING:
|
||||||
/* do something to get out of the chain function faster */
|
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = parent_class->change_state (element);
|
||||||
|
|
||||||
|
switch (transition) {
|
||||||
case GST_STATE_PLAYING_TO_PAUSED:
|
case GST_STATE_PLAYING_TO_PAUSED:
|
||||||
break;
|
break;
|
||||||
case GST_STATE_PAUSED_TO_READY:
|
case GST_STATE_PAUSED_TO_READY:
|
||||||
GST_STREAM_LOCK (mad->sinkpad);
|
|
||||||
mad_synth_finish (&mad->synth);
|
mad_synth_finish (&mad->synth);
|
||||||
mad_frame_finish (&mad->frame);
|
mad_frame_finish (&mad->frame);
|
||||||
mad_stream_finish (&mad->stream);
|
mad_stream_finish (&mad->stream);
|
||||||
|
@ -1649,11 +1654,11 @@ gst_mad_change_state (GstElement * element)
|
||||||
gst_tag_list_free (mad->tags);
|
gst_tag_list_free (mad->tags);
|
||||||
mad->tags = NULL;
|
mad->tags = NULL;
|
||||||
}
|
}
|
||||||
GST_STREAM_UNLOCK (mad->sinkpad);
|
|
||||||
break;
|
break;
|
||||||
case GST_STATE_READY_TO_NULL:
|
case GST_STATE_READY_TO_NULL:
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
return ret;
|
||||||
return parent_class->change_state (element);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -371,7 +371,6 @@ play_loop (GstPad * pad)
|
||||||
|
|
||||||
siddec = GST_SIDDEC (GST_PAD_PARENT (pad));
|
siddec = GST_SIDDEC (GST_PAD_PARENT (pad));
|
||||||
|
|
||||||
GST_STREAM_LOCK (pad);
|
|
||||||
out = gst_buffer_new_and_alloc (siddec->blocksize);
|
out = gst_buffer_new_and_alloc (siddec->blocksize);
|
||||||
gst_buffer_set_caps (out, GST_PAD_CAPS (pad));
|
gst_buffer_set_caps (out, GST_PAD_CAPS (pad));
|
||||||
|
|
||||||
|
@ -406,14 +405,11 @@ play_loop (GstPad * pad)
|
||||||
if ((ret = gst_pad_push (siddec->srcpad, out)) != GST_FLOW_OK)
|
if ((ret = gst_pad_push (siddec->srcpad, out)) != GST_FLOW_OK)
|
||||||
goto pause;
|
goto pause;
|
||||||
|
|
||||||
GST_STREAM_UNLOCK (pad);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
pause:
|
pause:
|
||||||
{
|
{
|
||||||
gst_task_pause (GST_RPAD_TASK (pad));
|
gst_pad_pause_task (pad);
|
||||||
GST_STREAM_UNLOCK (pad);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -434,16 +430,8 @@ start_play_tune (GstSidDec * siddec)
|
||||||
siddec->tune_number))
|
siddec->tune_number))
|
||||||
goto could_not_init;
|
goto could_not_init;
|
||||||
|
|
||||||
if (GST_ELEMENT_SCHEDULER (siddec)) {
|
res = gst_pad_start_task (siddec->srcpad,
|
||||||
GST_STREAM_LOCK (siddec->srcpad);
|
(GstTaskFunction) play_loop, siddec->srcpad);
|
||||||
GST_RPAD_TASK (siddec->srcpad) =
|
|
||||||
gst_scheduler_create_task (GST_ELEMENT_SCHEDULER (siddec),
|
|
||||||
(GstTaskFunction) play_loop, siddec->srcpad);
|
|
||||||
|
|
||||||
gst_task_start (GST_RPAD_TASK (siddec->srcpad));
|
|
||||||
GST_STREAM_UNLOCK (siddec->srcpad);
|
|
||||||
res = TRUE;
|
|
||||||
}
|
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
|
@ -502,14 +490,10 @@ gst_siddec_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
if (siddec->tune_len + size > maxSidtuneFileLen)
|
if (siddec->tune_len + size > maxSidtuneFileLen)
|
||||||
goto overflow;
|
goto overflow;
|
||||||
|
|
||||||
GST_STREAM_LOCK (pad);
|
|
||||||
|
|
||||||
memcpy (siddec->tune_buffer + siddec->tune_len, GST_BUFFER_DATA (buffer),
|
memcpy (siddec->tune_buffer + siddec->tune_len, GST_BUFFER_DATA (buffer),
|
||||||
size);
|
size);
|
||||||
siddec->tune_len += size;
|
siddec->tune_len += size;
|
||||||
|
|
||||||
GST_STREAM_UNLOCK (pad);
|
|
||||||
|
|
||||||
gst_buffer_unref (buffer);
|
gst_buffer_unref (buffer);
|
||||||
|
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
|
|
Loading…
Reference in a new issue