[vlc-commits] aout: use aout_RequestRestart() where applicable
Rémi Denis-Courmont
git at videolan.org
Sun Dec 16 15:50:13 CET 2012
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Dec 16 16:49:57 2012 +0200| [f74db532f7e4da596f5231e6cb676bb89e767ceb] | committer: Rémi Denis-Courmont
aout: use aout_RequestRestart() where applicable
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f74db532f7e4da596f5231e6cb676bb89e767ceb
---
include/vlc_aout.h | 11 ++++++++++-
modules/audio_output/alsa.c | 5 ++---
modules/audio_output/mmdevice.c | 10 ++--------
modules/audio_output/oss.c | 3 +--
modules/audio_output/pulse.c | 3 +--
src/audio_output/dec.c | 10 ----------
src/libvlccore.sym | 1 -
7 files changed, 16 insertions(+), 27 deletions(-)
diff --git a/include/vlc_aout.h b/include/vlc_aout.h
index ed459e2..de9986a 100644
--- a/include/vlc_aout.h
+++ b/include/vlc_aout.h
@@ -334,7 +334,16 @@ static inline void aout_RestartRequest(audio_output_t *aout, unsigned mode)
aout->event.restart_request(aout, mode);
}
-VLC_API int aout_ChannelsRestart( vlc_object_t *, const char *, vlc_value_t, vlc_value_t, void * );
+static inline int aout_ChannelsRestart (vlc_object_t *obj, const char *varname,
+ vlc_value_t oldval, vlc_value_t newval, void *data)
+{
+ audio_output_t *aout = (audio_output_t *)obj;
+ (void)varname; (void)oldval; (void)newval; (void)data;
+
+ aout_RestartRequest (aout, AOUT_RESTART_OUTPUT);
+ return 0;
+}
+
/* */
VLC_API vout_thread_t * aout_filter_RequestVout( filter_t *, vout_thread_t *p_vout, video_format_t *p_fmt ) VLC_USED;
diff --git a/modules/audio_output/alsa.c b/modules/audio_output/alsa.c
index 8e3861c..45d4945 100644
--- a/modules/audio_output/alsa.c
+++ b/modules/audio_output/alsa.c
@@ -792,9 +792,8 @@ static int DeviceSelect (audio_output_t *aout, const char *id)
var_Create (aout, "alsa-audio-device", VLC_VAR_STRING);
var_SetString (aout, "alsa-audio-device", id);
- vlc_value_t dummy;
- return aout_ChannelsRestart (VLC_OBJECT(aout), "audio-device",
- dummy, dummy, NULL);
+ aout_RestartRequest (aout, AOUT_RESTART_OUTPUT);
+ return 0;
}
static int Open(vlc_object_t *obj)
diff --git a/modules/audio_output/mmdevice.c b/modules/audio_output/mmdevice.c
index 6499c20..30ab642 100644
--- a/modules/audio_output/mmdevice.c
+++ b/modules/audio_output/mmdevice.c
@@ -104,10 +104,7 @@ static int vlc_FromHR(audio_output_t *aout, HRESULT hr)
{
/* Restart on unplug */
if (unlikely(hr == AUDCLNT_E_DEVICE_INVALIDATED))
- {
- vlc_value_t d;
- aout_ChannelsRestart(VLC_OBJECT(aout), "audio-device", d, d, NULL);
- }
+ aout_RestartRequest(aout, AOUT_RESTART_OUTPUT);
return SUCCEEDED(hr) ? 0 : -1;
}
@@ -652,11 +649,8 @@ static int DeviceSelect(audio_output_t *aout, const char *id)
LeaveMTA();
if (sys->stream != NULL)
- {
- vlc_value_t d;
/* Request restart of stream with the new device */
- aout_ChannelsRestart(VLC_OBJECT(aout), "audio-device", d, d, NULL);
- }
+ aout_RestartRequest(aout, AOUT_RESTART_OUTPUT);
return FAILED(hr) ? -1 : 0;
}
diff --git a/modules/audio_output/oss.c b/modules/audio_output/oss.c
index e3070d6..408bf76 100644
--- a/modules/audio_output/oss.c
+++ b/modules/audio_output/oss.c
@@ -86,11 +86,10 @@ static int MuteSet (audio_output_t *, bool);
static int DeviceChanged (vlc_object_t *obj, const char *varname,
vlc_value_t prev, vlc_value_t cur, void *data)
{
- aout_ChannelsRestart (obj, varname, prev, cur, data);
-
if (!var_Type (obj, "oss-audio-device"))
var_Create (obj, "oss-audio-device", VLC_VAR_STRING);
var_SetString (obj, "oss-audio-device", cur.psz_string);
+ aout_RestartRequest ((audio_output_t *)aout, AOUT_RESTART_OUTPUT);
return VLC_SUCCESS;
}
diff --git a/modules/audio_output/pulse.c b/modules/audio_output/pulse.c
index 5176151..fbf9a85 100644
--- a/modules/audio_output/pulse.c
+++ b/modules/audio_output/pulse.c
@@ -315,8 +315,7 @@ static void stream_event_cb(pa_stream *s, const char *name, pa_proplist *pl,
vlc_value_t dummy = { .i_int = 0 };
msg_Dbg (aout, "format lost");
- aout_ChannelsRestart (VLC_OBJECT(aout), "audio-device",
- dummy, dummy, NULL);
+ aout_RestartRequest (aout, AOUT_RESTART_OUTPUT);
} else
#endif
msg_Warn (aout, "unhandled stream event \"%s\"", name);
diff --git a/src/audio_output/dec.c b/src/audio_output/dec.c
index 6f2c06c..746c680 100644
--- a/src/audio_output/dec.c
+++ b/src/audio_output/dec.c
@@ -169,16 +169,6 @@ void aout_RequestRestart (audio_output_t *aout, unsigned mode)
atomic_fetch_or (&owner->restart, mode);
}
-int aout_ChannelsRestart (vlc_object_t *obj, const char *varname,
- vlc_value_t oldval, vlc_value_t newval, void *data)
-{
- audio_output_t *aout = (audio_output_t *)obj;
- (void)oldval; (void)newval; (void)data;
-
- aout_RequestRestart (aout, AOUT_RESTART_OUTPUT);
- return 0;
-}
-
/*
* Buffer management
*/
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index b4c03a6..8c5be17 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -3,7 +3,6 @@ AddMD5
aout_BitsPerSample
aout_ChannelExtract
aout_ChannelReorder
-aout_ChannelsRestart
aout_CheckChannelExtraction
aout_CheckChannelReorder
aout_filter_RequestVout
More information about the vlc-commits
mailing list