[vlc-commits] [Git][videolan/vlc][master] 2 commits: vout: fix direct cast
Steve Lhomme (@robUx4)
gitlab at videolan.org
Tue Jan 17 08:16:11 UTC 2023
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
da8f6760 by Steve Lhomme at 2023-01-17T07:58:07+00:00
vout: fix direct cast
Use the actual type passed to as opaque to the filter callbacks.
The vlc_object may not be the first element in the structure.
- - - - -
ab140977 by Steve Lhomme at 2023-01-17T07:58:07+00:00
player: avoid cast to vlc_object_t*
Use the generic macro that is often type safe.
- - - - -
3 changed files:
- src/player/player.c
- src/video_output/video_output.c
- src/video_output/vout_subpictures.c
Changes:
=====================================
src/player/player.c
=====================================
@@ -1864,7 +1864,7 @@ vlc_player_GetV4l2Object(vlc_player_t *player)
{
struct vlc_player_input *input = vlc_player_get_input_locked(player);
return input && var_Type(input->thread, "controls") != 0 ?
- (vlc_object_t*) input->thread : NULL;
+ VLC_OBJECT(input->thread) : NULL;
}
static void
=====================================
src/video_output/video_output.c
=====================================
@@ -718,7 +718,8 @@ static int FilterRestartCallback(vlc_object_t *p_this, char const *psz_var,
static int DelFilterCallbacks(filter_t *filter, void *opaque)
{
- filter_DelProxyCallbacks((vlc_object_t*)opaque, filter,
+ vout_thread_sys_t *sys = opaque;
+ filter_DelProxyCallbacks(VLC_OBJECT(sys), filter,
FilterRestartCallback);
return VLC_SUCCESS;
}
=====================================
src/video_output/vout_subpictures.c
=====================================
@@ -1372,14 +1372,16 @@ static int RestartSubFilterCallback(vlc_object_t *obj, char const *psz_var,
static int SubFilterAddProxyCallbacks(filter_t *filter, void *opaque)
{
- filter_AddProxyCallbacks((vlc_object_t *)opaque, filter,
+ vout_thread_t *vout = opaque;
+ filter_AddProxyCallbacks(VLC_OBJECT(vout), filter,
RestartSubFilterCallback);
return VLC_SUCCESS;
}
static int SubFilterDelProxyCallbacks(filter_t *filter, void *opaque)
{
- filter_DelProxyCallbacks((vlc_object_t *)opaque, filter,
+ vout_thread_t *vout = opaque;
+ filter_DelProxyCallbacks(VLC_OBJECT(vout), filter,
RestartSubFilterCallback);
return VLC_SUCCESS;
}
@@ -1401,7 +1403,8 @@ static int SubSourceAddProxyCallbacks(filter_t *filter, void *opaque)
static int SubSourceDelProxyCallbacks(filter_t *filter, void *opaque)
{
- filter_DelProxyCallbacks((vlc_object_t *)opaque, filter,
+ vout_thread_t *vout = opaque;
+ filter_DelProxyCallbacks(VLC_OBJECT(vout), filter,
RestartSubSourceCallback);
return VLC_SUCCESS;
}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/894ecb9fc83a2ae784fb5ed072ad15623c4c5229...ab1409774462f06e7eecf75af9229639fd4ca9ee
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/894ecb9fc83a2ae784fb5ed072ad15623c4c5229...ab1409774462f06e7eecf75af9229639fd4ca9ee
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list