Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
6699fb71
Commit
6699fb71
authored
Aug 04, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aout: allow "forking" the volume and mute flag per aout instance
parent
d50e54d5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
13 deletions
+12
-13
src/audio_output/intf.c
src/audio_output/intf.c
+12
-13
No files found.
src/audio_output/intf.c
View file @
6699fb71
...
@@ -68,11 +68,14 @@ static void prepareVolume (vlc_object_t *obj, audio_output_t **aoutp,
...
@@ -68,11 +68,14 @@ static void prepareVolume (vlc_object_t *obj, audio_output_t **aoutp,
/* FIXME: we need interlocking even if aout does not exist! */
/* FIXME: we need interlocking even if aout does not exist! */
*
aoutp
=
aout
;
*
aoutp
=
aout
;
if
(
aout
!=
NULL
)
if
(
aout
!=
NULL
)
{
obj
=
VLC_OBJECT
(
aout
);
/* use aout volume if aout exists */
aout_lock_volume
(
aout
);
aout_lock_volume
(
aout
);
}
if
(
volp
!=
NULL
)
if
(
volp
!=
NULL
)
*
volp
=
var_
Ge
tInteger
(
obj
,
"volume"
);
*
volp
=
var_
Inheri
tInteger
(
obj
,
"volume"
);
if
(
mutep
!=
NULL
)
if
(
mutep
!=
NULL
)
*
mutep
=
var_
Ge
tBool
(
obj
,
"mute"
);
*
mutep
=
var_
Inheri
tBool
(
obj
,
"mute"
);
}
}
/** Commit a volume change transaction. */
/** Commit a volume change transaction. */
...
@@ -81,6 +84,7 @@ static int commitVolume (vlc_object_t *obj, audio_output_t *aout,
...
@@ -81,6 +84,7 @@ static int commitVolume (vlc_object_t *obj, audio_output_t *aout,
{
{
int
ret
=
0
;
int
ret
=
0
;
/* update caller (input manager) volume */
var_SetInteger
(
obj
,
"volume"
,
volume
);
var_SetInteger
(
obj
,
"volume"
,
volume
);
var_SetBool
(
obj
,
"mute"
,
mute
);
var_SetBool
(
obj
,
"mute"
,
mute
);
...
@@ -89,10 +93,15 @@ static int commitVolume (vlc_object_t *obj, audio_output_t *aout,
...
@@ -89,10 +93,15 @@ static int commitVolume (vlc_object_t *obj, audio_output_t *aout,
aout_owner_t
*
owner
=
aout_owner
(
aout
);
aout_owner_t
*
owner
=
aout_owner
(
aout
);
float
vol
=
volume
/
(
float
)
AOUT_VOLUME_DEFAULT
;
float
vol
=
volume
/
(
float
)
AOUT_VOLUME_DEFAULT
;
/* apply volume to the pipeline */
aout_lock
(
aout
);
aout_lock
(
aout
);
if
(
owner
->
module
!=
NULL
)
if
(
owner
->
module
!=
NULL
)
ret
=
aout
->
pf_volume_set
(
aout
,
vol
,
mute
);
ret
=
aout
->
pf_volume_set
(
aout
,
vol
,
mute
);
aout_unlock
(
aout
);
aout_unlock
(
aout
);
/* update aout volume if it maintains its own */
var_SetInteger
(
aout
,
"volume"
,
volume
);
var_SetBool
(
aout
,
"mute"
,
mute
);
aout_unlock_volume
(
aout
);
aout_unlock_volume
(
aout
);
if
(
ret
==
0
)
if
(
ret
==
0
)
...
@@ -102,7 +111,6 @@ static int commitVolume (vlc_object_t *obj, audio_output_t *aout,
...
@@ -102,7 +111,6 @@ static int commitVolume (vlc_object_t *obj, audio_output_t *aout,
return
ret
;
return
ret
;
}
}
#if 0
/** Cancel a volume change transaction. */
/** Cancel a volume change transaction. */
static
void
cancelVolume
(
vlc_object_t
*
obj
,
audio_output_t
*
aout
)
static
void
cancelVolume
(
vlc_object_t
*
obj
,
audio_output_t
*
aout
)
{
{
...
@@ -113,7 +121,6 @@ static void cancelVolume (vlc_object_t *obj, audio_output_t *aout)
...
@@ -113,7 +121,6 @@ static void cancelVolume (vlc_object_t *obj, audio_output_t *aout)
vlc_object_release
(
aout
);
vlc_object_release
(
aout
);
}
}
}
}
#endif
#undef aout_VolumeGet
#undef aout_VolumeGet
/**
/**
...
@@ -121,16 +128,12 @@ static void cancelVolume (vlc_object_t *obj, audio_output_t *aout)
...
@@ -121,16 +128,12 @@ static void cancelVolume (vlc_object_t *obj, audio_output_t *aout)
*/
*/
audio_volume_t
aout_VolumeGet
(
vlc_object_t
*
obj
)
audio_volume_t
aout_VolumeGet
(
vlc_object_t
*
obj
)
{
{
#if 0
audio_output_t
*
aout
;
audio_output_t
*
aout
;
audio_volume_t
volume
;
audio_volume_t
volume
;
prepareVolume
(
obj
,
&
aout
,
&
volume
,
NULL
);
prepareVolume
(
obj
,
&
aout
,
&
volume
,
NULL
);
cancelVolume
(
obj
,
aout
);
cancelVolume
(
obj
,
aout
);
return 0;
return
volume
;
#else
return
var_GetInteger
(
obj
,
"volume"
);
#endif
}
}
#undef aout_VolumeSet
#undef aout_VolumeSet
...
@@ -201,16 +204,12 @@ int aout_ToggleMute (vlc_object_t *obj, audio_volume_t *volp)
...
@@ -201,16 +204,12 @@ int aout_ToggleMute (vlc_object_t *obj, audio_volume_t *volp)
*/
*/
bool
aout_IsMuted
(
vlc_object_t
*
obj
)
bool
aout_IsMuted
(
vlc_object_t
*
obj
)
{
{
#if 0
audio_output_t
*
aout
;
audio_output_t
*
aout
;
bool
mute
;
bool
mute
;
prepareVolume
(
obj
,
&
aout
,
NULL
,
&
mute
);
prepareVolume
(
obj
,
&
aout
,
NULL
,
&
mute
);
cancelVolume
(
obj
,
aout
);
cancelVolume
(
obj
,
aout
);
return
mute
;
return
mute
;
#else
return
var_GetBool
(
obj
,
"mute"
);
#endif
}
}
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment