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
bdb59d19
Commit
bdb59d19
authored
Oct 03, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PulseAudio: add stream event callback and handle "format-lost"
parent
504617b7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
modules/audio_output/pulse.c
modules/audio_output/pulse.c
+22
-0
No files found.
modules/audio_output/pulse.c
View file @
bdb59d19
...
@@ -355,6 +355,26 @@ static void stream_state_cb(pa_stream *s, void *userdata)
...
@@ -355,6 +355,26 @@ static void stream_state_cb(pa_stream *s, void *userdata)
(
void
)
userdata
;
(
void
)
userdata
;
}
}
static
void
stream_event_cb
(
pa_stream
*
s
,
const
char
*
name
,
pa_proplist
*
pl
,
void
*
userdata
)
{
audio_output_t
*
aout
=
userdata
;
#if PA_CHECK_VERSION(1,0,0)
/* FIXME: expose aout_Restart() directly */
if
(
!
strcmp
(
name
,
PA_STREAM_EVENT_FORMAT_LOST
))
{
vlc_value_t
dummy
=
{
.
i_int
=
0
};
msg_Dbg
(
aout
,
"format lost"
);
aout_ChannelsRestart
(
VLC_OBJECT
(
aout
),
"audio-device"
,
dummy
,
dummy
,
NULL
);
}
else
#endif
msg_Warn
(
aout
,
"unhandled event %s"
,
name
);
(
void
)
s
;
(
void
)
pl
;
}
static
void
stream_moved_cb
(
pa_stream
*
s
,
void
*
userdata
)
static
void
stream_moved_cb
(
pa_stream
*
s
,
void
*
userdata
)
{
{
audio_output_t
*
aout
=
userdata
;
audio_output_t
*
aout
=
userdata
;
...
@@ -791,6 +811,7 @@ static int Open(vlc_object_t *obj)
...
@@ -791,6 +811,7 @@ static int Open(vlc_object_t *obj)
}
}
sys
->
stream
=
s
;
sys
->
stream
=
s
;
pa_stream_set_state_callback
(
s
,
stream_state_cb
,
NULL
);
pa_stream_set_state_callback
(
s
,
stream_state_cb
,
NULL
);
pa_stream_set_event_callback
(
s
,
stream_event_cb
,
aout
);
pa_stream_set_latency_update_callback
(
s
,
stream_latency_cb
,
aout
);
pa_stream_set_latency_update_callback
(
s
,
stream_latency_cb
,
aout
);
pa_stream_set_moved_callback
(
s
,
stream_moved_cb
,
aout
);
pa_stream_set_moved_callback
(
s
,
stream_moved_cb
,
aout
);
pa_stream_set_overflow_callback
(
s
,
stream_overflow_cb
,
aout
);
pa_stream_set_overflow_callback
(
s
,
stream_overflow_cb
,
aout
);
...
@@ -856,6 +877,7 @@ static void Close (vlc_object_t *obj)
...
@@ -856,6 +877,7 @@ static void Close (vlc_object_t *obj)
/* Clear all callbacks */
/* Clear all callbacks */
pa_stream_set_state_callback
(
s
,
NULL
,
NULL
);
pa_stream_set_state_callback
(
s
,
NULL
,
NULL
);
pa_stream_set_event_callback
(
s
,
NULL
,
NULL
);
pa_stream_set_latency_update_callback
(
s
,
NULL
,
NULL
);
pa_stream_set_latency_update_callback
(
s
,
NULL
,
NULL
);
pa_stream_set_moved_callback
(
s
,
NULL
,
NULL
);
pa_stream_set_moved_callback
(
s
,
NULL
,
NULL
);
pa_stream_set_overflow_callback
(
s
,
NULL
,
NULL
);
pa_stream_set_overflow_callback
(
s
,
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