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
5871680a
Commit
5871680a
authored
Dec 22, 2009
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
media_player: Emit an event when the root media is changed.
parent
43db2ff1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
include/vlc/libvlc_events.h
include/vlc/libvlc_events.h
+9
-1
src/control/media_player.c
src/control/media_player.c
+9
-0
No files found.
include/vlc/libvlc_events.h
View file @
5871680a
...
...
@@ -101,7 +101,9 @@ extern "C" {
DEF( VlmMediaInstanceStatusPause ), \
DEF( VlmMediaInstanceStatusEnd ), \
DEF( VlmMediaInstanceStatusError ), \
/* New event types HERE */
\
DEF( MediaPlayerMediaChanged ), \
/* New event types HERE */
#ifdef __cplusplus
enum
libvlc_event_type_e
{
...
...
@@ -248,6 +250,12 @@ struct libvlc_event_t
const
char
*
psz_media_name
;
const
char
*
psz_instance_name
;
}
vlm_media_event
;
/* Extra MediaPlayer */
struct
{
libvlc_media_t
*
new_media
;
}
media_player_media_changed
;
}
u
;
};
...
...
src/control/media_player.c
View file @
5871680a
...
...
@@ -393,6 +393,8 @@ libvlc_media_player_new( libvlc_instance_t *instance, libvlc_exception_t *e )
/* Snapshot initialization */
register_event
(
mp
,
SnapshotTaken
);
register_event
(
mp
,
MediaChanged
);
/* Attach a var callback to the global object to provide the glue between
* vout_thread that generates the event and media_player that re-emits it
* with its own event manager
...
...
@@ -533,6 +535,13 @@ void libvlc_media_player_set_media(
p_mi
->
p_libvlc_instance
=
p_md
->
p_libvlc_instance
;
unlock
(
p_mi
);
/* Send an event for the newly available media */
libvlc_event_t
event
;
event
.
type
=
libvlc_MediaPlayerMediaChanged
;
event
.
u
.
media_player_media_changed
.
new_media
=
p_md
;
libvlc_event_send
(
p_mi
->
p_event_manager
,
&
event
);
}
/**************************************************************************
...
...
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