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
9f27fbd9
Commit
9f27fbd9
authored
Jan 16, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PulseAudio: implement and fix changing device while not playing
parent
9c4c35d1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
modules/audio_output/pulse.c
modules/audio_output/pulse.c
+17
-2
No files found.
modules/audio_output/pulse.c
View file @
9f27fbd9
...
...
@@ -75,6 +75,7 @@ struct aout_sys_t
mtime_t
first_pts
;
/**< Play time of buffer start */
mtime_t
paused
;
/**< Time when (last) paused */
char
*
sink_force
;
/**< Forced sink name (stream must be NULL) */
struct
sink
*
sinks
;
/**< Locally-cached list of sinks */
};
...
...
@@ -681,6 +682,15 @@ static int SinksList(audio_output_t *aout, char ***namesp, char ***descsp)
static
int
StreamMove
(
audio_output_t
*
aout
,
const
char
*
name
)
{
aout_sys_t
*
sys
=
aout
->
sys
;
if
(
sys
->
stream
==
NULL
)
{
msg_Dbg
(
aout
,
"will connect to sink %s"
,
name
);
free
(
sys
->
sink_force
);
sys
->
sink_force
=
strdup
(
name
);
return
0
;
}
pa_operation
*
op
;
uint32_t
idx
=
pa_stream_get_index
(
sys
->
stream
);
...
...
@@ -694,7 +704,7 @@ static int StreamMove(audio_output_t *aout, const char *name)
vlc_pa_error
(
aout
,
"cannot move sink input"
,
sys
->
context
);
pa_threaded_mainloop_unlock
(
sys
->
mainloop
);
return
(
op
!=
NULL
)
?
VLC_SUCCESS
:
VLC_EGENERIC
;
return
(
op
!=
NULL
)
?
0
:
-
1
;
}
static
void
Stop
(
audio_output_t
*
);
...
...
@@ -896,11 +906,14 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
pa_stream_set_suspended_callback
(
s
,
stream_suspended_cb
,
aout
);
pa_stream_set_underflow_callback
(
s
,
stream_underflow_cb
,
aout
);
if
(
pa_stream_connect_playback
(
s
,
NULL
,
&
attr
,
flags
,
NULL
,
NULL
)
<
0
if
(
pa_stream_connect_playback
(
s
,
sys
->
sink_force
,
&
attr
,
flags
,
NULL
,
NULL
)
<
0
||
stream_wait
(
s
,
sys
->
mainloop
))
{
vlc_pa_error
(
aout
,
"stream connection failure"
,
sys
->
context
);
goto
fail
;
}
free
(
sys
->
sink_force
);
sys
->
sink_force
=
NULL
;
const
struct
pa_sample_spec
*
spec
=
pa_stream_get_sample_spec
(
s
);
#if PA_CHECK_VERSION(1,0,0)
...
...
@@ -983,6 +996,7 @@ static int Open(vlc_object_t *obj)
}
sys
->
stream
=
NULL
;
sys
->
context
=
ctx
;
sys
->
sink_force
=
NULL
;
sys
->
sinks
=
NULL
;
aout
->
sys
=
sys
;
...
...
@@ -1032,5 +1046,6 @@ static void Close(vlc_object_t *obj)
free
(
sink
->
description
);
free
(
sink
);
}
free
(
sys
->
sink_force
);
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