Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
9d225f9f
Commit
9d225f9f
authored
Jan 16, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PulseAudio: implement mute/unmute while not playing
parent
9f27fbd9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
modules/audio_output/pulse.c
modules/audio_output/pulse.c
+11
-3
No files found.
modules/audio_output/pulse.c
View file @
9d225f9f
...
@@ -75,7 +75,9 @@ struct aout_sys_t
...
@@ -75,7 +75,9 @@ struct aout_sys_t
mtime_t
first_pts
;
/**< Play time of buffer start */
mtime_t
first_pts
;
/**< Play time of buffer start */
mtime_t
paused
;
/**< Time when (last) paused */
mtime_t
paused
;
/**< Time when (last) paused */
pa_stream_flags_t
flags_force
;
/**< Forced flags (stream must be NULL) */
char
*
sink_force
;
/**< Forced sink name (stream must be NULL) */
char
*
sink_force
;
/**< Forced sink name (stream must be NULL) */
struct
sink
*
sinks
;
/**< Locally-cached list of sinks */
struct
sink
*
sinks
;
/**< Locally-cached list of sinks */
};
};
...
@@ -640,10 +642,13 @@ static int VolumeSet(audio_output_t *aout, float vol)
...
@@ -640,10 +642,13 @@ static int VolumeSet(audio_output_t *aout, float vol)
static
int
MuteSet
(
audio_output_t
*
aout
,
bool
mute
)
static
int
MuteSet
(
audio_output_t
*
aout
,
bool
mute
)
{
{
aout_sys_t
*
sys
=
aout
->
sys
;
aout_sys_t
*
sys
=
aout
->
sys
;
if
(
sys
->
stream
==
NULL
)
if
(
sys
->
stream
==
NULL
)
{
{
msg_Err
(
aout
,
"cannot change volume while not playing"
);
sys
->
flags_force
&=
~
(
PA_STREAM_START_MUTED
|
PA_STREAM_START_UNMUTED
);
return
-
1
;
sys
->
flags_force
|=
mute
?
PA_STREAM_START_MUTED
:
PA_STREAM_START_UNMUTED
;
return
0
;
}
}
pa_operation
*
op
;
pa_operation
*
op
;
...
@@ -823,7 +828,8 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
...
@@ -823,7 +828,8 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
}
}
/* Stream parameters */
/* Stream parameters */
const
pa_stream_flags_t
flags
=
PA_STREAM_START_CORKED
const
pa_stream_flags_t
flags
=
sys
->
flags_force
|
PA_STREAM_START_CORKED
|
PA_STREAM_INTERPOLATE_TIMING
|
PA_STREAM_INTERPOLATE_TIMING
|
PA_STREAM_NOT_MONOTONIC
|
PA_STREAM_NOT_MONOTONIC
|
PA_STREAM_AUTO_TIMING_UPDATE
|
PA_STREAM_AUTO_TIMING_UPDATE
...
@@ -912,6 +918,7 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
...
@@ -912,6 +918,7 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
vlc_pa_error
(
aout
,
"stream connection failure"
,
sys
->
context
);
vlc_pa_error
(
aout
,
"stream connection failure"
,
sys
->
context
);
goto
fail
;
goto
fail
;
}
}
sys
->
flags_force
=
PA_STREAM_NOFLAGS
;
free
(
sys
->
sink_force
);
free
(
sys
->
sink_force
);
sys
->
sink_force
=
NULL
;
sys
->
sink_force
=
NULL
;
...
@@ -996,6 +1003,7 @@ static int Open(vlc_object_t *obj)
...
@@ -996,6 +1003,7 @@ static int Open(vlc_object_t *obj)
}
}
sys
->
stream
=
NULL
;
sys
->
stream
=
NULL
;
sys
->
context
=
ctx
;
sys
->
context
=
ctx
;
sys
->
flags_force
=
PA_STREAM_NOFLAGS
;
sys
->
sink_force
=
NULL
;
sys
->
sink_force
=
NULL
;
sys
->
sinks
=
NULL
;
sys
->
sinks
=
NULL
;
...
...
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