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
2b1a7345
Commit
2b1a7345
authored
Oct 06, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PulseAudio: keep track of available devices (fix #5412)
parent
cec96f5c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletion
+21
-1
modules/audio_output/pulse.c
modules/audio_output/pulse.c
+21
-1
No files found.
modules/audio_output/pulse.c
View file @
2b1a7345
...
@@ -77,6 +77,7 @@ struct aout_sys_t
...
@@ -77,6 +77,7 @@ struct aout_sys_t
unsigned
rate
;
/**< Current stream sample rate */
unsigned
rate
;
/**< Current stream sample rate */
};
};
static
void
sink_list_cb
(
pa_context
*
,
const
pa_sink_info
*
,
int
,
void
*
);
static
void
sink_input_info_cb
(
pa_context
*
,
const
pa_sink_input_info
*
,
static
void
sink_input_info_cb
(
pa_context
*
,
const
pa_sink_input_info
*
,
int
,
void
*
);
int
,
void
*
);
...
@@ -90,6 +91,23 @@ static void context_cb(pa_context *ctx, pa_subscription_event_type_t type,
...
@@ -90,6 +91,23 @@ static void context_cb(pa_context *ctx, pa_subscription_event_type_t type,
switch
(
type
&
PA_SUBSCRIPTION_EVENT_FACILITY_MASK
)
switch
(
type
&
PA_SUBSCRIPTION_EVENT_FACILITY_MASK
)
{
{
case
PA_SUBSCRIPTION_EVENT_SINK
:
switch
(
type
&
PA_SUBSCRIPTION_EVENT_TYPE_MASK
)
{
case
PA_SUBSCRIPTION_EVENT_NEW
:
case
PA_SUBSCRIPTION_EVENT_CHANGE
:
op
=
pa_context_get_sink_info_by_index
(
ctx
,
idx
,
sink_list_cb
,
aout
);
if
(
likely
(
op
!=
NULL
))
pa_operation_unref
(
op
);
break
;
case
PA_SUBSCRIPTION_EVENT_REMOVE
:
var_Change
(
aout
,
"audio-device"
,
VLC_VAR_DELCHOICE
,
&
(
vlc_value_t
){
.
i_int
=
idx
},
NULL
);
break
;
}
break
;
case
PA_SUBSCRIPTION_EVENT_SINK_INPUT
:
case
PA_SUBSCRIPTION_EVENT_SINK_INPUT
:
if
(
idx
!=
pa_stream_get_index
(
sys
->
stream
))
if
(
idx
!=
pa_stream_get_index
(
sys
->
stream
))
break
;
/* only interested in our sink input */
break
;
/* only interested in our sink input */
...
@@ -131,6 +149,7 @@ static void sink_list_cb(pa_context *c, const pa_sink_info *i, int eol,
...
@@ -131,6 +149,7 @@ static void sink_list_cb(pa_context *c, const pa_sink_info *i, int eol,
i
->
description
);
i
->
description
);
val
.
i_int
=
i
->
index
;
val
.
i_int
=
i
->
index
;
text
.
psz_string
=
(
char
*
)
i
->
description
;
text
.
psz_string
=
(
char
*
)
i
->
description
;
var_Change
(
aout
,
"audio-device"
,
VLC_VAR_DELCHOICE
,
&
val
,
NULL
);
var_Change
(
aout
,
"audio-device"
,
VLC_VAR_ADDCHOICE
,
&
val
,
&
text
);
var_Change
(
aout
,
"audio-device"
,
VLC_VAR_ADDCHOICE
,
&
val
,
&
text
);
}
}
...
@@ -826,7 +845,8 @@ static int Open(vlc_object_t *obj)
...
@@ -826,7 +845,8 @@ static int Open(vlc_object_t *obj)
sys
->
rate
=
ss
.
rate
;
sys
->
rate
=
ss
.
rate
;
/* Context events */
/* Context events */
const
pa_subscription_mask_t
mask
=
PA_SUBSCRIPTION_MASK_SINK_INPUT
;
const
pa_subscription_mask_t
mask
=
PA_SUBSCRIPTION_MASK_SINK
|
PA_SUBSCRIPTION_MASK_SINK_INPUT
;
pa_context_set_subscribe_callback
(
ctx
,
context_cb
,
aout
);
pa_context_set_subscribe_callback
(
ctx
,
context_cb
,
aout
);
op
=
pa_context_subscribe
(
ctx
,
mask
,
NULL
,
NULL
);
op
=
pa_context_subscribe
(
ctx
,
mask
,
NULL
,
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