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
2cb0954e
Commit
2cb0954e
authored
Oct 08, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Open a specific PulseAudio source if specified
(VLC can now record desktop audio!)
parent
cf5313ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
modules/access/pulse.c
modules/access/pulse.c
+12
-1
No files found.
modules/access/pulse.c
View file @
2cb0954e
...
...
@@ -31,6 +31,10 @@
#include <pulse/pulseaudio.h>
#include "../audio_output/vlcpulse.h"
#define HELP_TEXT N_( \
"Pass pulse:// to open the default PulseAudio source, " \
"or pulse://SOURCE to open a specific source named SOURCE.")
static
int
Open
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
...
...
@@ -40,6 +44,8 @@ vlc_module_begin ()
set_capability
(
"access_demux"
,
0
)
set_category
(
CAT_INPUT
)
set_subcategory
(
SUBCAT_INPUT_ACCESS
)
set_help
(
HELP_TEXT
)
add_shortcut
(
"pulse"
,
"pulseaudio"
,
"pa"
)
set_callbacks
(
Open
,
Close
)
vlc_module_end
()
...
...
@@ -264,6 +270,11 @@ static int Open(vlc_object_t *obj)
|
PA_STREAM_FIX_FORMAT
|
PA_STREAM_FIX_RATE
/*| PA_STREAM_FIX_CHANNELS*/
;
const
char
*
dev
=
NULL
;
if
(
demux
->
psz_location
!=
NULL
&&
demux
->
psz_location
[
0
]
!=
'\0'
)
dev
=
demux
->
psz_location
;
const
struct
pa_buffer_attr
attr
=
{
.
maxlength
=
-
1
,
.
fragsize
=
pa_usec_to_bytes
(
sys
->
caching
,
&
ss
)
/
2
,
...
...
@@ -288,7 +299,7 @@ static int Open(vlc_object_t *obj)
pa_stream_set_suspended_callback
(
s
,
stream_suspended_cb
,
demux
);
pa_stream_set_underflow_callback
(
s
,
stream_underflow_cb
,
demux
);
if
(
pa_stream_connect_record
(
s
,
NULL
,
&
attr
,
flags
)
<
0
if
(
pa_stream_connect_record
(
s
,
dev
,
&
attr
,
flags
)
<
0
||
stream_wait
(
s
,
sys
->
mainloop
))
{
vlc_pa_error
(
obj
,
"cannot connect record stream"
,
sys
->
context
);
goto
error
;
...
...
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