Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
3cf52073
Commit
3cf52073
authored
Jan 24, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libvlc_event_detach: remove exception
parent
2c57cb80
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
23 additions
and
34 deletions
+23
-34
include/vlc/libvlc.h
include/vlc/libvlc.h
+1
-3
src/control/event.c
src/control/event.c
+1
-3
src/control/hierarchical_media_list_view.c
src/control/hierarchical_media_list_view.c
+4
-4
src/control/hierarchical_node_media_list_view.c
src/control/hierarchical_node_media_list_view.c
+5
-5
src/control/media_list_player.c
src/control/media_list_player.c
+2
-2
src/control/media_list_view.c
src/control/media_list_view.c
+6
-10
test/libvlc/events.c
test/libvlc/events.c
+4
-7
No files found.
include/vlc/libvlc.h
View file @
3cf52073
...
...
@@ -309,13 +309,11 @@ VLC_PUBLIC_API void libvlc_event_attach( libvlc_event_manager_t *p_event_manager
* \param i_event_type the desired event to which we want to unregister
* \param f_callback the function to call when i_event_type occurs
* \param p_user_data user provided data to carry with the event
* \param p_e an initialized exception pointer
*/
VLC_PUBLIC_API
void
libvlc_event_detach
(
libvlc_event_manager_t
*
p_event_manager
,
libvlc_event_type_t
i_event_type
,
libvlc_callback_t
f_callback
,
void
*
p_user_data
,
libvlc_exception_t
*
p_e
);
void
*
p_user_data
);
/**
* Get an event's type name.
...
...
src/control/event.c
View file @
3cf52073
...
...
@@ -355,10 +355,8 @@ void libvlc_event_attach_async( libvlc_event_manager_t * p_event_manager,
void
libvlc_event_detach
(
libvlc_event_manager_t
*
p_event_manager
,
libvlc_event_type_t
event_type
,
libvlc_callback_t
pf_callback
,
void
*
p_user_data
,
libvlc_exception_t
*
p_e
)
void
*
p_user_data
)
{
VLC_UNUSED
(
p_e
);
libvlc_event_listeners_group_t
*
listeners_group
;
libvlc_event_listener_t
*
listener
;
int
i
,
j
;
...
...
src/control/hierarchical_media_list_view.c
View file @
3cf52073
...
...
@@ -145,16 +145,16 @@ hierarch_media_list_view_release( libvlc_media_list_view_t * p_mlv )
{
libvlc_event_detach
(
p_mlv
->
p_mlist
->
p_event_manager
,
libvlc_MediaListItemAdded
,
media_list_item_added
,
p_mlv
,
NULL
);
media_list_item_added
,
p_mlv
);
libvlc_event_detach
(
p_mlv
->
p_mlist
->
p_event_manager
,
libvlc_MediaListWillAddItem
,
media_list_will_add_item
,
p_mlv
,
NULL
);
media_list_will_add_item
,
p_mlv
);
libvlc_event_detach
(
p_mlv
->
p_mlist
->
p_event_manager
,
libvlc_MediaListItemDeleted
,
media_list_item_deleted
,
p_mlv
,
NULL
);
media_list_item_deleted
,
p_mlv
);
libvlc_event_detach
(
p_mlv
->
p_mlist
->
p_event_manager
,
libvlc_MediaListWillDeleteItem
,
media_list_will_delete_item
,
p_mlv
,
NULL
);
media_list_will_delete_item
,
p_mlv
);
}
/**************************************************************************
...
...
src/control/hierarchical_node_media_list_view.c
View file @
3cf52073
...
...
@@ -235,7 +235,7 @@ media_list_item_deleted( const libvlc_event_t * p_event, void * user_data )
if
(
index
>=
0
)
libvlc_media_list_view_item_deleted
(
p_mlv
,
p_md
,
index
);
libvlc_event_detach
(
p_md
->
p_event_manager
,
libvlc_MediaSubItemAdded
,
items_subitems_added
,
p_mlv
,
NULL
);
items_subitems_added
,
p_mlv
);
}
static
void
media_list_will_delete_item
(
const
libvlc_event_t
*
p_event
,
void
*
user_data
)
...
...
@@ -266,16 +266,16 @@ hierarch_node_media_list_view_release( libvlc_media_list_view_t * p_mlv )
trace
(
"
\n
"
);
libvlc_event_detach
(
p_mlv
->
p_mlist
->
p_event_manager
,
libvlc_MediaListItemAdded
,
media_list_item_added
,
p_mlv
,
NULL
);
media_list_item_added
,
p_mlv
);
libvlc_event_detach
(
p_mlv
->
p_mlist
->
p_event_manager
,
libvlc_MediaListWillAddItem
,
media_list_will_add_item
,
p_mlv
,
NULL
);
media_list_will_add_item
,
p_mlv
);
libvlc_event_detach
(
p_mlv
->
p_mlist
->
p_event_manager
,
libvlc_MediaListItemDeleted
,
media_list_item_deleted
,
p_mlv
,
NULL
);
media_list_item_deleted
,
p_mlv
);
libvlc_event_detach
(
p_mlv
->
p_mlist
->
p_event_manager
,
libvlc_MediaListWillDeleteItem
,
media_list_will_delete_item
,
p_mlv
,
NULL
);
media_list_will_delete_item
,
p_mlv
);
}
/**************************************************************************
...
...
src/control/media_list_player.c
View file @
3cf52073
...
...
@@ -369,7 +369,7 @@ uninstall_playlist_observer(libvlc_media_list_player_t * p_mlp)
{
assert_locked
(
p_mlp
);
if
(
!
p_mlp
->
p_mlist
)
return
;
libvlc_event_detach
(
mlist_em
(
p_mlp
),
libvlc_MediaListItemDeleted
,
mlist_item_deleted
,
p_mlp
,
NULL
);
libvlc_event_detach
(
mlist_em
(
p_mlp
),
libvlc_MediaListItemDeleted
,
mlist_item_deleted
,
p_mlp
);
}
/**************************************************************************
...
...
@@ -398,7 +398,7 @@ uninstall_media_player_observer(libvlc_media_list_player_t * p_mlp)
// Allow callbacks to run, because detach() will wait until all callbacks are processed.
// This is safe because only callbacks are allowed, and there execution will be cancelled.
vlc_mutex_unlock
(
&
p_mlp
->
mp_callback_lock
);
libvlc_event_detach
(
mplayer_em
(
p_mlp
),
libvlc_MediaPlayerEndReached
,
media_player_reached_end
,
p_mlp
,
NULL
);
libvlc_event_detach
(
mplayer_em
(
p_mlp
),
libvlc_MediaPlayerEndReached
,
media_player_reached_end
,
p_mlp
);
// Now, lock back the callback lock. No more callback will be present from this point.
vlc_mutex_lock
(
&
p_mlp
->
mp_callback_lock
);
...
...
src/control/media_list_view.c
View file @
3cf52073
...
...
@@ -103,22 +103,18 @@ uninstall_md_listener( libvlc_media_list_view_t * p_mlv,
libvlc_media_t
*
p_md
)
{
libvlc_media_list_t
*
p_mlist
;
libvlc_exception_t
ignored_exception
;
libvlc_exception_init
(
&
ignored_exception
);
libvlc_event_detach
(
p_md
->
p_event_manager
,
libvlc_MediaSubItemAdded
,
media_list_subitem_added
,
p_mlv
,
&
ignored_exception
);
if
(
libvlc_exception_raised
(
&
ignored_exception
)
)
libvlc_exception_clear
(
&
ignored_exception
);
/* We don't care if we encounter an exception */
media_list_subitem_added
,
p_mlv
);
if
((
p_mlist
=
libvlc_media_subitems
(
p_md
)))
{
libvlc_media_list_lock
(
p_mlist
);
libvlc_event_detach
(
p_mlist
->
p_event_manager
,
libvlc_MediaListItemAdded
,
media_list_item_added
,
p_mlv
,
NULL
);
media_list_item_added
,
p_mlv
);
libvlc_event_detach
(
p_mlist
->
p_event_manager
,
libvlc_MediaListItemDeleted
,
media_list_item_removed
,
p_mlv
,
NULL
);
media_list_item_removed
,
p_mlv
);
int
i
,
count
=
libvlc_media_list_count
(
p_mlist
,
NULL
);
for
(
i
=
0
;
i
<
count
;
i
++
)
...
...
@@ -166,7 +162,7 @@ media_list_subitem_added( const libvlc_event_t * p_event, void * p_user_data )
* thus, no need to wait for SubItemAdded events */
libvlc_event_detach
(
p_md
->
p_event_manager
,
libvlc_MediaSubItemAdded
,
media_list_subitem_added
,
p_mlv
,
NULL
);
media_list_subitem_added
,
p_mlv
);
libvlc_media_list_lock
(
p_mlist
);
libvlc_event_attach
(
p_mlist
->
p_event_manager
,
...
...
@@ -383,13 +379,13 @@ libvlc_media_list_view_release( libvlc_media_list_view_t * p_mlv )
{
libvlc_event_detach
(
p_mlv
->
p_mlist
->
p_event_manager
,
libvlc_MediaListItemAdded
,
media_list_item_added
,
p_mlv
,
NULL
);
media_list_item_added
,
p_mlv
);
}
if
(
p_mlv
->
pf_ml_item_removed
)
{
libvlc_event_detach
(
p_mlv
->
p_mlist
->
p_event_manager
,
libvlc_MediaListItemDeleted
,
media_list_item_removed
,
p_mlv
,
NULL
);
media_list_item_removed
,
p_mlv
);
}
int
i
,
count
=
libvlc_media_list_count
(
p_mlv
->
p_mlist
,
NULL
);
for
(
i
=
0
;
i
<
count
;
i
++
)
...
...
test/libvlc/events.c
View file @
3cf52073
...
...
@@ -42,7 +42,7 @@ static void test_events_callback_and_detach( const libvlc_event_t * event, void
em
=
libvlc_media_player_event_manager
(
event
->
p_obj
);
libvlc_event_detach
(
em
,
event
->
type
,
test_events_callback_and_detach
,
user_data
,
&
ex
);
libvlc_event_detach
(
em
,
event
->
type
,
test_events_callback_and_detach
,
user_data
);
*
callback_was_called
=
true
;
}
...
...
@@ -101,8 +101,7 @@ static void test_events (const char ** argv, int argc)
event
.
type
=
mi_events
[
mi_events_len
-
1
];
callback_was_called
=
false
;
libvlc_event_detach
(
em
,
mi_events
[
mi_events_len
-
1
],
test_events_dummy_callback
,
&
callback_was_called
,
&
ex
);
catch
();
libvlc_event_detach
(
em
,
mi_events
[
mi_events_len
-
1
],
test_events_dummy_callback
,
&
callback_was_called
);
libvlc_event_attach
(
em
,
mi_events
[
mi_events_len
-
1
],
test_events_callback_and_detach
,
&
callback_was_called
,
&
ex
);
catch
();
...
...
@@ -116,10 +115,8 @@ static void test_events (const char ** argv, int argc)
log
(
"+ Testing regular detach()
\n
"
);
for
(
i
=
0
;
i
<
mi_events_len
-
1
;
i
++
)
{
libvlc_event_detach
(
em
,
mi_events
[
i
],
test_events_dummy_callback
,
&
callback_was_called
,
&
ex
);
catch
();
}
for
(
i
=
0
;
i
<
mi_events_len
-
1
;
i
++
)
libvlc_event_detach
(
em
,
mi_events
[
i
],
test_events_dummy_callback
,
&
callback_was_called
);
libvlc_media_player_release
(
mi
);
catch
();
...
...
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