Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
d9cf7d2f
Commit
d9cf7d2f
authored
Dec 08, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
amem: defer set_volume() before setup()
Before setup(), opaque is not defined.
parent
1a5aaf25
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
modules/audio_output/amem.c
modules/audio_output/amem.c
+12
-0
No files found.
modules/audio_output/amem.c
View file @
d9cf7d2f
...
...
@@ -77,6 +77,7 @@ struct aout_sys_t
int
(
*
set_volume
)
(
void
*
opaque
,
float
vol
,
bool
mute
);
float
volume
;
bool
mute
;
bool
ready
;
};
static
void
Play
(
audio_output_t
*
aout
,
block_t
*
block
)
...
...
@@ -111,6 +112,8 @@ static int VolumeSet (audio_output_t *aout, float vol)
aout_sys_t
*
sys
=
aout
->
sys
;
sys
->
volume
=
vol
;
if
(
sys
->
ready
)
return
0
;
/* sys->opaque is not yet defined... */
return
sys
->
set_volume
(
sys
->
opaque
,
vol
,
sys
->
mute
)
?
-
1
:
0
;
}
...
...
@@ -119,6 +122,8 @@ static int MuteSet (audio_output_t *aout, bool mute)
aout_sys_t
*
sys
=
aout
->
sys
;
sys
->
mute
=
mute
;
if
(
!
sys
->
ready
)
return
0
;
/* sys->opaque is not yet defined... */
return
sys
->
set_volume
(
sys
->
opaque
,
sys
->
volume
,
mute
)
?
-
1
:
0
;
}
...
...
@@ -163,6 +168,11 @@ static int Start (audio_output_t *aout, audio_sample_format_t *fmt)
channels
=
sys
->
channels
;
}
/* Initialize volume (in case the UI changed volume before setup) */
sys
->
ready
=
true
;
if
(
sys
->
set_volume
!=
NULL
)
sys
->
set_volume
(
sys
->
opaque
,
sys
->
volume
,
sys
->
mute
);
if
(
fmt
->
i_rate
==
0
||
fmt
->
i_rate
>
192000
||
channels
==
0
||
channels
>
AOUT_CHAN_MAX
)
return
VLC_EGENERIC
;
...
...
@@ -219,6 +229,7 @@ static void Stop (audio_output_t *aout)
if
(
sys
->
cleanup
!=
NULL
)
sys
->
cleanup
(
sys
->
opaque
);
sys
->
ready
=
false
;
}
static
int
Open
(
vlc_object_t
*
obj
)
...
...
@@ -249,6 +260,7 @@ static int Open (vlc_object_t *obj)
sys
->
set_volume
=
var_InheritAddress
(
obj
,
"amem-set-volume"
);
sys
->
volume
=
1
.;
sys
->
mute
=
false
;
sys
->
ready
=
false
;
if
(
sys
->
play
==
NULL
)
{
free
(
sys
);
...
...
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