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
027588c6
Commit
027588c6
authored
Jan 15, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PulseAudio: revector, no functional changes
parent
5d21b65c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
56 deletions
+71
-56
modules/audio_output/pulse.c
modules/audio_output/pulse.c
+71
-56
No files found.
modules/audio_output/pulse.c
View file @
027588c6
...
...
@@ -68,62 +68,6 @@ struct aout_sys_t
mtime_t
paused
;
/**< Time when (last) paused */
};
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
*
,
int
,
void
*
);
/*** Context ***/
static
void
context_cb
(
pa_context
*
ctx
,
pa_subscription_event_type_t
type
,
uint32_t
idx
,
void
*
userdata
)
{
audio_output_t
*
aout
=
userdata
;
aout_sys_t
*
sys
=
aout
->
sys
;
pa_operation
*
op
;
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
:
if
(
sys
->
stream
==
NULL
||
idx
!=
pa_stream_get_index
(
sys
->
stream
))
break
;
/* only interested in our sink input */
/* Gee... PA will not provide the infos directly in the event. */
switch
(
type
&
PA_SUBSCRIPTION_EVENT_TYPE_MASK
)
{
case
PA_SUBSCRIPTION_EVENT_REMOVE
:
msg_Err
(
aout
,
"sink input killed!"
);
break
;
default:
op
=
pa_context_get_sink_input_info
(
ctx
,
idx
,
sink_input_info_cb
,
aout
);
if
(
likely
(
op
!=
NULL
))
pa_operation_unref
(
op
);
break
;
}
break
;
default:
/* unsubscribed facility?! */
assert
(
0
);
}
}
/*** Sink ***/
static
void
sink_list_cb
(
pa_context
*
c
,
const
pa_sink_info
*
i
,
int
eol
,
...
...
@@ -154,6 +98,28 @@ static void sink_list_cb(pa_context *c, const pa_sink_info *i, int eol,
}
}
static
void
sink_event
(
pa_context
*
ctx
,
unsigned
type
,
uint32_t
idx
,
audio_output_t
*
aout
)
{
pa_operation
*
op
;
switch
(
type
)
{
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
;
}
}
static
void
sink_info_cb
(
pa_context
*
c
,
const
pa_sink_info
*
i
,
int
eol
,
void
*
userdata
)
{
...
...
@@ -407,6 +373,55 @@ static void sink_input_info_cb(pa_context *ctx, const pa_sink_input_info *i,
aout_MuteReport
(
aout
,
i
->
mute
);
}
static
void
sink_input_event
(
pa_context
*
ctx
,
pa_subscription_event_type_t
type
,
uint32_t
idx
,
audio_output_t
*
aout
)
{
pa_operation
*
op
;
/* Gee... PA will not provide the infos directly in the event. */
switch
(
type
)
{
case
PA_SUBSCRIPTION_EVENT_REMOVE
:
msg_Err
(
aout
,
"sink input killed!"
);
break
;
default:
op
=
pa_context_get_sink_input_info
(
ctx
,
idx
,
sink_input_info_cb
,
aout
);
if
(
likely
(
op
!=
NULL
))
pa_operation_unref
(
op
);
break
;
}
}
/*** Context ***/
static
void
context_cb
(
pa_context
*
ctx
,
pa_subscription_event_type_t
type
,
uint32_t
idx
,
void
*
userdata
)
{
audio_output_t
*
aout
=
userdata
;
aout_sys_t
*
sys
=
aout
->
sys
;
unsigned
facility
=
type
&
PA_SUBSCRIPTION_EVENT_FACILITY_MASK
;
type
&=
PA_SUBSCRIPTION_EVENT_TYPE_MASK
;
switch
(
facility
)
{
case
PA_SUBSCRIPTION_EVENT_SINK
:
sink_event
(
ctx
,
type
,
idx
,
userdata
);
break
;
case
PA_SUBSCRIPTION_EVENT_SINK_INPUT
:
/* only interested in our sink input */
if
(
sys
->
stream
!=
NULL
&&
idx
==
pa_stream_get_index
(
sys
->
stream
))
sink_input_event
(
ctx
,
type
,
idx
,
userdata
);
break
;
default:
/* unsubscribed facility?! */
assert
(
0
);
}
}
/*** VLC audio output callbacks ***/
...
...
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