mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
pulsesink: Only use gst_audio_clock_new() when compiling against newer base
This commit is contained in:
parent
415b205be3
commit
10424a4064
3 changed files with 10 additions and 4 deletions
|
@ -91,7 +91,7 @@ gst_pulsemixer_ctrl_sink_info_cb (pa_context * context, const pa_sink_info * i,
|
||||||
c->index = i->index;
|
c->index = i->index;
|
||||||
c->channel_map = i->channel_map;
|
c->channel_map = i->channel_map;
|
||||||
c->volume = i->volume;
|
c->volume = i->volume;
|
||||||
c->muted = !!i->mute;
|
c->muted = ! !i->mute;
|
||||||
c->type = GST_PULSEMIXER_SINK;
|
c->type = GST_PULSEMIXER_SINK;
|
||||||
|
|
||||||
if (c->track) {
|
if (c->track) {
|
||||||
|
@ -141,7 +141,7 @@ gst_pulsemixer_ctrl_source_info_cb (pa_context * context,
|
||||||
c->index = i->index;
|
c->index = i->index;
|
||||||
c->channel_map = i->channel_map;
|
c->channel_map = i->channel_map;
|
||||||
c->volume = i->volume;
|
c->volume = i->volume;
|
||||||
c->muted = !!i->mute;
|
c->muted = ! !i->mute;
|
||||||
c->type = GST_PULSEMIXER_SOURCE;
|
c->type = GST_PULSEMIXER_SOURCE;
|
||||||
|
|
||||||
if (c->track) {
|
if (c->track) {
|
||||||
|
@ -195,7 +195,7 @@ gst_pulsemixer_ctrl_success_cb (pa_context * context, int success,
|
||||||
{
|
{
|
||||||
GstPulseMixerCtrl *c = (GstPulseMixerCtrl *) userdata;
|
GstPulseMixerCtrl *c = (GstPulseMixerCtrl *) userdata;
|
||||||
|
|
||||||
c->operation_success = !!success;
|
c->operation_success = ! !success;
|
||||||
pa_threaded_mainloop_signal (c->mainloop, 0);
|
pa_threaded_mainloop_signal (c->mainloop, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2503,10 +2503,16 @@ gst_pulsesink_change_state (GstElement * element, GstStateChange transition)
|
||||||
/* override with a custom clock */
|
/* override with a custom clock */
|
||||||
if (GST_BASE_AUDIO_SINK (pulsesink)->provided_clock)
|
if (GST_BASE_AUDIO_SINK (pulsesink)->provided_clock)
|
||||||
gst_object_unref (GST_BASE_AUDIO_SINK (pulsesink)->provided_clock);
|
gst_object_unref (GST_BASE_AUDIO_SINK (pulsesink)->provided_clock);
|
||||||
|
#if GST_CHECK_VERSION(0, 10, 31) || (GST_CHECK_VERSION(0, 10, 30) && GST_VERSION_NANO > 0)
|
||||||
GST_BASE_AUDIO_SINK (pulsesink)->provided_clock =
|
GST_BASE_AUDIO_SINK (pulsesink)->provided_clock =
|
||||||
gst_audio_clock_new_full ("GstPulseSinkClock",
|
gst_audio_clock_new_full ("GstPulseSinkClock",
|
||||||
(GstAudioClockGetTimeFunc) gst_pulsesink_get_time,
|
(GstAudioClockGetTimeFunc) gst_pulsesink_get_time,
|
||||||
gst_object_ref (pulsesink), (GDestroyNotify) gst_object_unref);
|
gst_object_ref (pulsesink), (GDestroyNotify) gst_object_unref);
|
||||||
|
#else
|
||||||
|
GST_BASE_AUDIO_SINK (pulsesink)->provided_clock =
|
||||||
|
gst_audio_clock_new ("GstPulseSinkClock",
|
||||||
|
(GstAudioClockGetTimeFunc) gst_pulsesink_get_time, pulsesink);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
||||||
gst_element_post_message (element,
|
gst_element_post_message (element,
|
||||||
|
|
|
@ -1028,7 +1028,7 @@ gst_pulsesrc_success_cb (pa_stream * s, int success, void *userdata)
|
||||||
{
|
{
|
||||||
GstPulseSrc *pulsesrc = GST_PULSESRC_CAST (userdata);
|
GstPulseSrc *pulsesrc = GST_PULSESRC_CAST (userdata);
|
||||||
|
|
||||||
pulsesrc->operation_success = !!success;
|
pulsesrc->operation_success = ! !success;
|
||||||
pa_threaded_mainloop_signal (pulsesrc->mainloop, 0);
|
pa_threaded_mainloop_signal (pulsesrc->mainloop, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue