[vlc-commits] aout: introduce aout_Hold() and aout_Release()
Rémi Denis-Courmont
git at videolan.org
Wed Mar 6 21:57:50 CET 2019
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Mar 6 20:03:08 2019 +0200| [d2c1bc4433e1f194cd257d87d71e3ee6654b6236] | committer: Rémi Denis-Courmont
aout: introduce aout_Hold() and aout_Release()
Type-safe replacements for vlc_object_hold() and vlc_object_release()
(as discussed during the last workshop).
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d2c1bc4433e1f194cd257d87d71e3ee6654b6236
---
include/vlc_input.h | 4 ++--
include/vlc_objects.h | 13 +++++++++++
include/vlc_player.h | 2 +-
lib/audio.c | 18 +++++++--------
lib/media_player.c | 2 +-
modules/control/hotkeys.c | 2 +-
modules/control/oldrc.c | 4 ++--
modules/gui/macosx/menus/VLCMainMenu.m | 8 +++----
.../panels/VLCAudioEffectsWindowController.m | 26 +++++++++++-----------
modules/gui/qt/components/extended_panels.cpp | 16 ++++++-------
modules/gui/qt/input_manager.cpp | 4 ++--
modules/gui/qt/menus.cpp | 4 ++--
modules/gui/skins2/src/vlcproc.cpp | 2 +-
modules/gui/skins2/vars/equalizer.cpp | 4 ++--
modules/lua/libs/equalizer.c | 20 ++++++++---------
modules/lua/libs/objects.c | 12 +++++++++-
src/input/decoder.c | 2 +-
src/input/input.c | 4 ++--
src/input/player.c | 14 ++++++------
src/input/resource.c | 2 +-
src/playlist_legacy/aout.c | 12 +++++-----
src/text/strings.c | 2 +-
22 files changed, 100 insertions(+), 77 deletions(-)
diff --git a/include/vlc_input.h b/include/vlc_input.h
index 6b2c513d27..f5ca89762d 100644
--- a/include/vlc_input.h
+++ b/include/vlc_input.h
@@ -705,7 +705,7 @@ static inline int input_UpdateViewpoint( input_thread_t *p_input,
* Return the audio output (if any) associated with an input.
* @param p_input an input thread
* @return NULL on error, or the audio output (which needs to be
- * released with vlc_object_release()).
+ * released with aout_Release()).
*/
static inline audio_output_t *input_GetAout( input_thread_t *p_input )
{
@@ -782,7 +782,7 @@ VLC_API void input_resource_Terminate( input_resource_t * );
/**
* \return the current audio output if any.
- * Use vlc_object_release() to drop the reference.
+ * Use aout_Release() to drop the reference.
*/
VLC_API audio_output_t *input_resource_HoldAout( input_resource_t * );
diff --git a/include/vlc_objects.h b/include/vlc_objects.h
index 720c86639b..aef56e88ec 100644
--- a/include/vlc_objects.h
+++ b/include/vlc_objects.h
@@ -197,6 +197,19 @@ static inline void vout_Release(vout_thread_t *vout)
vlc_object_release((vlc_object_t *)vout);
}
+/* Here for backward compatibility. TODO: Move to <vlc_aout.h>! */
+static inline audio_output_t *aout_Hold(audio_output_t *aout)
+{
+ vlc_object_hold((vlc_object_t *)aout);
+ return aout;
+}
+
+static inline void aout_Release(audio_output_t *aout)
+{
+ vlc_object_release((vlc_object_t *)aout);
+}
+
+
/**
* @defgroup objres Object resources
*
diff --git a/include/vlc_player.h b/include/vlc_player.h
index 739953ca70..07d1680e37 100644
--- a/include/vlc_player.h
+++ b/include/vlc_player.h
@@ -2449,7 +2449,7 @@ vlc_player_SetPauseOnCork(vlc_player_t *player, bool enabled);
/**
* Get the audio output
*
- * @warning The returned pointer must be released with vlc_object_release().
+ * @warning The returned pointer must be released with aout_Release().
*
* @param player player instance
* @return a valid audio_output_t * or NULL (if there is no aouts)
diff --git a/lib/audio.c b/lib/audio.c
index 1842de34f1..751584d0f1 100644
--- a/lib/audio.c
+++ b/lib/audio.c
@@ -153,7 +153,7 @@ libvlc_audio_output_device_enum( libvlc_media_player_t *mp )
char **values, **texts;
int n = aout_DevicesList( aout, &values, &texts );
- vlc_object_release( aout );
+ aout_Release(aout);
if( n < 0 )
goto err;
@@ -256,7 +256,7 @@ void libvlc_audio_output_device_set( libvlc_media_player_t *mp,
return;
aout_DeviceSet( aout, devid );
- vlc_object_release( aout );
+ aout_Release(aout);
}
char *libvlc_audio_output_device_get( libvlc_media_player_t *mp )
@@ -267,7 +267,7 @@ char *libvlc_audio_output_device_get( libvlc_media_player_t *mp )
char *devid = aout_DeviceGet( aout );
- vlc_object_release( aout );
+ aout_Release(aout);
return devid;
}
@@ -287,7 +287,7 @@ int libvlc_audio_get_mute( libvlc_media_player_t *mp )
if( aout != NULL )
{
mute = aout_MuteGet( aout );
- vlc_object_release( aout );
+ aout_Release(aout);
}
return mute;
}
@@ -298,7 +298,7 @@ void libvlc_audio_set_mute( libvlc_media_player_t *mp, int mute )
if( aout != NULL )
{
mute = aout_MuteSet( aout, mute );
- vlc_object_release( aout );
+ aout_Release(aout);
}
}
@@ -310,7 +310,7 @@ int libvlc_audio_get_volume( libvlc_media_player_t *mp )
if( aout != NULL )
{
float vol = aout_VolumeGet( aout );
- vlc_object_release( aout );
+ aout_Release(aout);
volume = lroundf( vol * 100.f );
}
return volume;
@@ -330,7 +330,7 @@ int libvlc_audio_set_volume( libvlc_media_player_t *mp, int volume )
if( aout != NULL )
{
ret = aout_VolumeSet( aout, vol );
- vlc_object_release( aout );
+ aout_Release(aout);
}
return ret;
}
@@ -417,7 +417,7 @@ int libvlc_audio_get_channel( libvlc_media_player_t *mp )
return 0;
int val = var_GetInteger( p_aout, "stereo-mode" );
- vlc_object_release( p_aout );
+ aout_Release(p_aout);
return val;
}
@@ -437,7 +437,7 @@ int libvlc_audio_set_channel( libvlc_media_player_t *mp, int channel )
libvlc_printerr( "Audio channel out of range" );
ret = -1;
}
- vlc_object_release( p_aout );
+ aout_Release(p_aout);
return ret;
}
diff --git a/lib/media_player.c b/lib/media_player.c
index 468c144da1..87e7f4f1aa 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -2005,7 +2005,7 @@ int libvlc_media_player_set_equalizer( libvlc_media_player_t *p_mi, libvlc_equal
}
var_SetString( p_aout, "audio-filter", p_equalizer ? "equalizer" : "" );
- vlc_object_release( p_aout );
+ aout_Release(p_aout);
}
return 0;
diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c
index 0793d2ad9f..8472c12771 100644
--- a/modules/control/hotkeys.c
+++ b/modules/control/hotkeys.c
@@ -564,7 +564,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
if( !aout_DeviceSet( p_aout, ids[idx] ) )
DisplayMessage( p_vout, _("Audio Device: %s"), names[idx] );
- vlc_object_release( p_aout );
+ aout_Release(p_aout);
for( int i = 0; i < n; i++ )
{
diff --git a/modules/control/oldrc.c b/modules/control/oldrc.c
index 86d43203f1..985091f130 100644
--- a/modules/control/oldrc.c
+++ b/modules/control/oldrc.c
@@ -1643,7 +1643,7 @@ static int AudioDevice( vlc_object_t *obj, char const *cmd,
else
aout_DeviceSet( p_aout, cur.psz_string );
out:
- vlc_object_release( p_aout );
+ aout_Release(p_aout);
(void) old; (void) dummy;
return VLC_SUCCESS;
}
@@ -1688,7 +1688,7 @@ static int AudioChannel( vlc_object_t *obj, char const *cmd,
else
ret = var_SetInteger( p_aout, "stereo-mode", atoi( cur.psz_string ) );
out:
- vlc_object_release( p_aout );
+ aout_Release(p_aout);
(void) old; (void) dummy;
return ret;
}
diff --git a/modules/gui/macosx/menus/VLCMainMenu.m b/modules/gui/macosx/menus/VLCMainMenu.m
index e5d32b94cc..0d71515044 100644
--- a/modules/gui/macosx/menus/VLCMainMenu.m
+++ b/modules/gui/macosx/menus/VLCMainMenu.m
@@ -579,7 +579,7 @@
[self setupVarMenuItem:_visual target: (vlc_object_t *)p_aout
var:"visual" selector: @selector(toggleVar:)];
- vlc_object_release(p_aout);
+ aout_Release(p_aout);
}
vout_thread_t *p_vout = getVoutForActiveWindow();
@@ -879,7 +879,7 @@
int n = aout_DevicesList(p_aout, &ids, &names);
if (n == -1) {
- vlc_object_release(p_aout);
+ aout_Release(p_aout);
return;
}
@@ -891,7 +891,7 @@
[_tmp setTarget:self];
[_tmp setTag:[[NSString stringWithFormat:@"%s", ids[x]] intValue]];
}
- vlc_object_release(p_aout);
+ aout_Release(p_aout);
[[_audioDeviceMenu itemWithTag:[[NSString stringWithFormat:@"%s", currentDevice] intValue]] setState:NSOnState];
@@ -924,7 +924,7 @@
if (returnValue != 0)
msg_Warn(getIntf(), "failed to set audio device %li", [sender tag]);
- vlc_object_release(p_aout);
+ aout_Release(p_aout);
[self refreshAudioDeviceList];
}
diff --git a/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m b/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
index 59364e79c9..a61994c650 100644
--- a/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
+++ b/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
@@ -204,7 +204,7 @@
}
if (p_aout)
- vlc_object_release(p_aout);
+ aout_Release(p_aout);
}
- (void)windowDidLoad
@@ -618,7 +618,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
if (!psz_string)
psz_string = var_GetNonEmptyString(p_aout, "audio-filter");
- vlc_object_release(p_aout);
+ aout_Release(p_aout);
if (!psz_string)
return false;
@@ -658,7 +658,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
char *psz_preset_string = var_GetNonEmptyString(p_aout, "equalizer-preset");
currentPreset = toNSStr(psz_preset_string);
free(psz_preset_string);
- vlc_object_release(p_aout);
+ aout_Release(p_aout);
}
NSUInteger currentPresetIndex = 0;
@@ -759,7 +759,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
char const *psz_preset_values = [[self generatePresetString] UTF8String];
if (p_aout) {
var_SetString(p_aout, "equalizer-bands", psz_preset_values);
- vlc_object_release(p_aout);
+ aout_Release(p_aout);
}
var_SetString(pl_Get(getIntf()), "equalizer-bands", psz_preset_values);
}
@@ -778,7 +778,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
var_SetString(p_aout, "equalizer-bands", psz_eq_bands);
var_SetFloat(p_aout, "equalizer-preamp", f_eq_preamp);
var_SetString(p_aout, "equalizer-preset" , psz_eq_preset);
- vlc_object_release(p_aout);
+ aout_Release(p_aout);
}
[_equalizerPreampSlider setFloatValue: f_eq_preamp];
@@ -796,7 +796,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
audio_output_t *p_aout = getAout();
if (p_aout) {
var_SetFloat(p_aout, "equalizer-preamp", fPreamp);
- vlc_object_release(p_aout);
+ aout_Release(p_aout);
}
var_SetFloat(pl_Get(getIntf()), "equalizer-preamp", fPreamp);
}
@@ -808,7 +808,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
audio_output_t *p_aout = getAout();
if (p_aout) {
var_SetBool(p_aout, "equalizer-2pass", b_2p);
- vlc_object_release(p_aout);
+ aout_Release(p_aout);
}
var_SetBool(pl_Get(getIntf()), "equalizer-2pass", b_2p);
@@ -850,7 +850,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
audio_output_t *p_aout = getAout();
if (p_aout) {
var_SetString(p_aout, "equalizer-preset", psz_eq_preset);
- vlc_object_release(p_aout);
+ aout_Release(p_aout);
}
var_SetString(pl_Get(getIntf()), "equalizer-preset", psz_eq_preset);
@@ -949,7 +949,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
var_SetFloat(p_aout, "compressor-ratio", 8.000000);
var_SetFloat(p_aout, "compressor-knee", 2.500000);
var_SetFloat(p_aout, "compressor-makeup-gain", 7.000000);
- vlc_object_release(p_aout);
+ aout_Release(p_aout);
}
[self resetCompressor];
}
@@ -985,7 +985,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
audio_output_t *p_aout = getAout();
if (p_aout) {
var_SetFloat(p_aout, psz_property, f_value);
- vlc_object_release(p_aout);
+ aout_Release(p_aout);
}
var_SetFloat(pl_Get(getIntf()), psz_property, f_value);
@@ -1051,7 +1051,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
var_SetFloat(p_aout, "spatializer-wet", .4);
var_SetFloat(p_aout, "spatializer-dry", .5);
var_SetFloat(p_aout, "spatializer-damp", .5);
- vlc_object_release(p_aout);
+ aout_Release(p_aout);
}
[self resetSpatializer];
}
@@ -1083,7 +1083,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
audio_output_t *p_aout = getAout();
if (p_aout) {
var_SetFloat(p_aout, psz_property, f_value / 10.f);
- vlc_object_release(p_aout);
+ aout_Release(p_aout);
}
var_SetFloat(pl_Get(getIntf()), psz_property, f_value / 10.f);
@@ -1147,7 +1147,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
if (p_aout) {
var_SetFloat(p_aout, "norm-max-level", f_value);
- vlc_object_release(p_aout);
+ aout_Release(p_aout);
}
var_SetFloat(pl_Get(getIntf()), "norm-max-level", f_value);
diff --git a/modules/gui/qt/components/extended_panels.cpp b/modules/gui/qt/components/extended_panels.cpp
index 4b09b432a4..f6122d8592 100644
--- a/modules/gui/qt/components/extended_panels.cpp
+++ b/modules/gui/qt/components/extended_panels.cpp
@@ -879,13 +879,13 @@ float FilterSliderData::initialValue()
{
if ( var_Type( p_aout, qtu(p_data->name) ) == 0 )
{
- vlc_object_release( p_aout );
+ aout_Release(p_aout);
/* Not found, will try in config */
}
else
{
f = var_GetFloat( p_aout, qtu(p_data->name) );
- vlc_object_release( p_aout );
+ aout_Release(p_aout);
return f;
}
}
@@ -904,7 +904,7 @@ void FilterSliderData::onValueChanged( int i )
if ( p_aout )
{
var_SetFloat( p_aout, qtu(p_data->name), f );
- vlc_object_release( p_aout );
+ aout_Release(p_aout);
}
writeToConfig();
}
@@ -1025,7 +1025,7 @@ QStringList EqualizerSliderData::getBandsFromAout() const
free( psz_bands );
}
}
- vlc_object_release( p_aout );
+ aout_Release(p_aout);
}
if ( bands.count() ) return bands;
@@ -1066,7 +1066,7 @@ void EqualizerSliderData::onValueChanged( int i )
if ( p_aout )
{
var_SetString( p_aout, qtu(p_data->name), qtu(bands.join( " " )) );
- vlc_object_release( p_aout );
+ aout_Release(p_aout);
}
writeToConfig();
}
@@ -1228,7 +1228,7 @@ void Equalizer::build()
ui.eq2PassCheck->setChecked( var_InheritBool( p_aout, "equalizer-2pass" ) );
CONNECT( ui.eq2PassCheck, toggled(bool), this, enable2Pass(bool) );
if( p_aout )
- vlc_object_release( p_aout );
+ aout_Release(p_aout);
}
void Equalizer::setCorePreset( int i_preset )
@@ -1247,7 +1247,7 @@ void Equalizer::setCorePreset( int i_preset )
if( p_aout )
{
var_SetString( p_aout , "equalizer-preset" , preset_list[i_preset] );
- vlc_object_release( p_aout );
+ aout_Release(p_aout);
}
emit configChanged( qfu( "equalizer-preset" ), QVariant( qfu( preset_list[i_preset] ) ) );
}
@@ -1260,7 +1260,7 @@ void Equalizer::enable2Pass( bool b_enable )
if( p_aout )
{
var_SetBool( p_aout, "equalizer-2pass", b_enable );
- vlc_object_release( p_aout );
+ aout_Release(p_aout);
}
emit configChanged( qfu( "equalizer-2pass" ), QVariant( b_enable ) );
}
diff --git a/modules/gui/qt/input_manager.cpp b/modules/gui/qt/input_manager.cpp
index 9ce7a9ee1d..6d4c2d4468 100644
--- a/modules/gui/qt/input_manager.cpp
+++ b/modules/gui/qt/input_manager.cpp
@@ -565,7 +565,7 @@ bool InputManager::hasVisualisation()
return false;
char *visual = var_InheritString( aout, "visual" );
- vlc_object_release( aout );
+ aout_Release( aout );
if( !visual )
return false;
@@ -1238,7 +1238,7 @@ void MainInputManager::menusUpdateAudio( const QString& data )
if( aout != NULL )
{
aout_DeviceSet( aout, qtu(data) );
- vlc_object_release( aout );
+ aout_Release(aout);
}
}
diff --git a/modules/gui/qt/menus.cpp b/modules/gui/qt/menus.cpp
index 438745b188..b102fa6902 100644
--- a/modules/gui/qt/menus.cpp
+++ b/modules/gui/qt/menus.cpp
@@ -266,7 +266,7 @@ static int AudioAutoMenuBuilder( input_thread_t *p_input,
PUSH_VAR( "visual" );
if( p_object )
- vlc_object_release( p_object );
+ aout_Release( p_object );
return VLC_SUCCESS;
}
@@ -636,7 +636,7 @@ QMenu *VLCMenuBar::AudioMenu( intf_thread_t *p_intf, QMenu * current )
if( p_aout )
{
- vlc_object_release( p_aout );
+ aout_Release(p_aout);
}
return Populate( current, varnames, objects );
diff --git a/modules/gui/skins2/src/vlcproc.cpp b/modules/gui/skins2/src/vlcproc.cpp
index 25803a1872..6a4d543e1c 100644
--- a/modules/gui/skins2/src/vlcproc.cpp
+++ b/modules/gui/skins2/src/vlcproc.cpp
@@ -797,7 +797,7 @@ void VlcProc::init_equalizer()
pVarPreamp->set( (preamp + 20.0) / 40.0 );
if( pAout )
- vlc_object_release( pAout);
+ aout_Release(pAout);
}
void VlcProc::setFullscreenVar( bool b_fullscreen )
diff --git a/modules/gui/skins2/vars/equalizer.cpp b/modules/gui/skins2/vars/equalizer.cpp
index 4d949be385..b0eb6c6441 100644
--- a/modules/gui/skins2/vars/equalizer.cpp
+++ b/modules/gui/skins2/vars/equalizer.cpp
@@ -113,7 +113,7 @@ void EqualizerBands::onUpdate( Subject<VarPercent> &rBand, void *arg )
}
if( pAout )
- vlc_object_release( pAout );
+ aout_Release(pAout);
}
@@ -144,5 +144,5 @@ void EqualizerPreamp::set( float percentage, bool updateVLC )
}
if( pAout )
- vlc_object_release( pAout );
+ aout_Release(pAout);
}
diff --git a/modules/lua/libs/equalizer.c b/modules/lua/libs/equalizer.c
index 2d43a0e172..ea192dedf0 100644
--- a/modules/lua/libs/equalizer.c
+++ b/modules/lua/libs/equalizer.c
@@ -67,13 +67,13 @@ static int vlclua_preamp_get( lua_State *L )
if( !psz_af || strstr ( psz_af, "equalizer" ) == NULL )
{
free( psz_af );
- vlc_object_release( p_aout );
+ aout_Release(p_aout);
return 0;
}
free( psz_af );
lua_pushnumber( L, var_GetFloat( p_aout, "equalizer-preamp") );
- vlc_object_release( p_aout );
+ aout_Release(p_aout);
return 1;
}
@@ -92,13 +92,13 @@ static int vlclua_preamp_set( lua_State *L )
if( !psz_af || strstr ( psz_af, "equalizer" ) == NULL )
{
free( psz_af );
- vlc_object_release( p_aout );
+ aout_Release(p_aout);
return 0;
}
free( psz_af );
var_SetFloat( p_aout, "equalizer-preamp", luaL_checknumber( L, 1 ) );
- vlc_object_release( p_aout );
+ aout_Release(p_aout);
return 1;
}
@@ -132,7 +132,7 @@ static int vlclua_equalizer_get( lua_State *L )
if( !psz_af || strstr ( psz_af, "equalizer" ) == NULL )
{
free( psz_af );
- vlc_object_release( p_aout );
+ aout_Release(p_aout);
return 0;
}
free( psz_af );
@@ -141,7 +141,7 @@ static int vlclua_equalizer_get( lua_State *L )
psz_bands_origin = psz_bands = var_GetNonEmptyString( p_aout, "equalizer-bands" );
if( !psz_bands )
{
- vlc_object_release( p_aout );
+ aout_Release(p_aout);
return 0;
}
@@ -175,7 +175,7 @@ static int vlclua_equalizer_get( lua_State *L )
uselocale (oldloc);
freelocale (loc);
}
- vlc_object_release( p_aout );
+ aout_Release(p_aout);
return error ? 0 : 1;
}
@@ -198,7 +198,7 @@ static int vlclua_equalizer_set( lua_State *L )
if( !psz_af || strstr ( psz_af, "equalizer" ) == NULL )
{
free( psz_af );
- vlc_object_release( p_aout );
+ aout_Release(p_aout);
return 0;
}
free( psz_af );
@@ -233,7 +233,7 @@ static int vlclua_equalizer_set( lua_State *L )
freelocale (loc);
}
free( bands );
- vlc_object_release( p_aout );
+ aout_Release(p_aout);
return 0;
}
@@ -259,7 +259,7 @@ static int vlclua_equalizer_setpreset( lua_State *L )
ret = 1;
}
free( psz_af );
- vlc_object_release( p_aout );
+ aout_Release(p_aout);
return ret;
}
diff --git a/modules/lua/libs/objects.c b/modules/lua/libs/objects.c
index 18ac94aa14..ab7985c7e1 100644
--- a/modules/lua/libs/objects.c
+++ b/modules/lua/libs/objects.c
@@ -140,6 +140,16 @@ static int vlclua_get_vout( lua_State *L )
lua_pushnil( L );
return 1;
}
+
+static int vlclua_aout_release(lua_State *L)
+{
+ vlc_object_t **pp = luaL_checkudata(L, 1, "vlc_object");
+
+ lua_pop(L, 1);
+ aout_Release((audio_output_t *)*pp);
+ return 0;
+}
+
static int vlclua_get_aout( lua_State *L )
{
playlist_t *p_playlist = vlclua_get_playlist_internal( L );
@@ -147,7 +157,7 @@ static int vlclua_get_aout( lua_State *L )
if( p_aout != NULL )
{
vlclua_push_vlc_object(L, (vlc_object_t *)p_aout,
- vlclua_object_release);
+ vlclua_aout_release);
return 1;
}
lua_pushnil( L );
diff --git a/src/input/decoder.c b/src/input/decoder.c
index d6ca661f86..38d3b81dcf 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -2551,7 +2551,7 @@ void input_DecoderGetObjects( decoder_t *p_dec,
vout_Hold(p_owner->p_vout) : NULL;
if( pp_aout )
*pp_aout = p_dec->fmt_in.i_cat == AUDIO_ES && p_owner->p_aout ?
- vlc_object_hold( p_owner->p_aout ) : NULL;
+ aout_Hold(p_owner->p_aout) : NULL;
vlc_mutex_unlock( &p_owner->lock );
}
diff --git a/src/input/input.c b/src/input/input.c
index 83800dca1d..c5e5f4379b 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -1762,7 +1762,7 @@ static void ViewpointApply( input_thread_t *p_input )
/* This variable can only be read from callbacks */
var_Change( p_aout, "viewpoint", VLC_VAR_SETVALUE,
(vlc_value_t) { .p_address = NULL } );
- vlc_object_release( p_aout );
+ aout_Release(p_aout);
}
}
@@ -1845,7 +1845,7 @@ static void ControlNav( input_thread_t *p_input, int i_type )
if( p_aout )
{
aout_VolumeUpdate( p_aout, vol_direction, NULL );
- vlc_object_release( p_aout );
+ aout_Release(p_aout);
}
}
}
diff --git a/src/input/player.c b/src/input/player.c
index 9b720e403b..20fa3a3d39 100644
--- a/src/input/player.c
+++ b/src/input/player.c
@@ -3081,7 +3081,7 @@ vlc_player_aout_GetVolume(vlc_player_t *player)
if (!aout)
return -1.f;
float vol = aout_VolumeGet(aout);
- vlc_object_release(aout);
+ aout_Release(aout);
return vol;
}
@@ -3093,7 +3093,7 @@ vlc_player_aout_SetVolume(vlc_player_t *player, float volume)
if (!aout)
return -1;
int ret = aout_VolumeSet(aout, volume);
- vlc_object_release(aout);
+ aout_Release(aout);
return ret;
}
@@ -3105,7 +3105,7 @@ vlc_player_aout_IncrementVolume(vlc_player_t *player, int steps, float *result)
if (!aout)
return -1;
int ret = aout_VolumeUpdate(aout, steps, result);
- vlc_object_release(aout);
+ aout_Release(aout);
return ret;
}
@@ -3117,7 +3117,7 @@ vlc_player_aout_IsMuted(vlc_player_t *player)
if (!aout)
return -1;
int ret = aout_MuteGet(aout);
- vlc_object_release(aout);
+ aout_Release(aout);
return ret;
}
@@ -3129,7 +3129,7 @@ vlc_player_aout_Mute(vlc_player_t *player, bool mute)
if (!aout)
return -1;
int ret = aout_MuteSet (aout, mute);
- vlc_object_release(aout);
+ aout_Release(aout);
return ret;
}
@@ -3142,7 +3142,7 @@ vlc_player_aout_EnableFilter(vlc_player_t *player, const char *name, bool add)
if (!aout)
return -1;
aout_EnableFilter(aout, name, add);
- vlc_object_release(aout);
+ aout_Release(aout);
return 0;
}
@@ -3469,7 +3469,7 @@ vlc_player_Delete(vlc_player_t *player)
var_DelCallback(aout, "volume", vlc_player_AoutCallback, player);
var_DelCallback(aout, "mute", vlc_player_AoutCallback, player);
var_DelCallback(player, "corks", vlc_player_CorkCallback, NULL);
- vlc_object_release(aout);
+ aout_Release(aout);
}
input_resource_Release(player->resource);
if (player->renderer)
diff --git a/src/input/resource.c b/src/input/resource.c
index 22719cf14a..6929621df1 100644
--- a/src/input/resource.c
+++ b/src/input/resource.c
@@ -299,7 +299,7 @@ audio_output_t *input_resource_HoldAout( input_resource_t *p_resource )
vlc_mutex_lock( &p_resource->lock_hold );
p_aout = p_resource->p_aout;
if( p_aout != NULL )
- vlc_object_hold( p_aout );
+ aout_Hold(p_aout);
vlc_mutex_unlock( &p_resource->lock_hold );
return p_aout;
diff --git a/src/playlist_legacy/aout.c b/src/playlist_legacy/aout.c
index 86777420f1..5a0af675eb 100644
--- a/src/playlist_legacy/aout.c
+++ b/src/playlist_legacy/aout.c
@@ -51,7 +51,7 @@ float playlist_VolumeGet (playlist_t *pl)
if (aout != NULL)
{
volume = aout_VolumeGet (aout);
- vlc_object_release (aout);
+ aout_Release(aout);
}
return volume;
}
@@ -64,7 +64,7 @@ int playlist_VolumeSet (playlist_t *pl, float vol)
if (aout != NULL)
{
ret = aout_VolumeSet (aout, vol);
- vlc_object_release (aout);
+ aout_Release(aout);
}
return ret;
}
@@ -82,7 +82,7 @@ int playlist_VolumeUp (playlist_t *pl, int value, float *volp)
if (aout != NULL)
{
ret = aout_VolumeUpdate (aout, value, volp);
- vlc_object_release (aout);
+ aout_Release(aout);
}
return ret;
}
@@ -95,7 +95,7 @@ int playlist_MuteGet (playlist_t *pl)
if (aout != NULL)
{
mute = aout_MuteGet (aout);
- vlc_object_release (aout);
+ aout_Release(aout);
}
return mute;
}
@@ -108,7 +108,7 @@ int playlist_MuteSet (playlist_t *pl, bool mute)
if (aout != NULL)
{
ret = aout_MuteSet (aout, mute);
- vlc_object_release (aout);
+ aout_Release(aout);
}
return ret;
}
@@ -119,6 +119,6 @@ void playlist_EnableAudioFilter (playlist_t *pl, const char *name, bool add)
if (aout)
{
aout_EnableFilter(aout, name, add);
- vlc_object_release (aout);
+ aout_Release(aout);
}
}
diff --git a/src/text/strings.c b/src/text/strings.c
index 21bbce5843..6fc57d5d92 100644
--- a/src/text/strings.c
+++ b/src/text/strings.c
@@ -771,7 +771,7 @@ char *vlc_strfinput(input_thread_t *input, input_item_t *item, const char *s)
if (aout != NULL)
{
vol = aout_VolumeGet(aout);
- vlc_object_release(aout);
+ aout_Release(aout);
}
}
if (vol >= 0.f)
More information about the vlc-commits
mailing list