mirror of
https://github.com/mpv-player/mpv
synced 2025-01-29 19:22:48 +00:00
dec_sub: fix locking for sub_is_{primary,secondary}_visible
These public functions should use locks to keep its usage
consistent with input.c.
Fixes: 024e0cd4c1
This commit is contained in:
parent
f4db4aaed7
commit
e731972163
@ -548,10 +548,16 @@ void sub_set_play_dir(struct dec_sub *sub, int dir)
|
||||
|
||||
bool sub_is_primary_visible(struct dec_sub *sub)
|
||||
{
|
||||
return sub->shared_opts->sub_visibility[0];
|
||||
mp_mutex_lock(&sub->lock);
|
||||
bool ret = sub->shared_opts->sub_visibility[0];
|
||||
mp_mutex_unlock(&sub->lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool sub_is_secondary_visible(struct dec_sub *sub)
|
||||
{
|
||||
return sub->shared_opts->sub_visibility[1];
|
||||
mp_mutex_lock(&sub->lock);
|
||||
bool ret = sub->shared_opts->sub_visibility[1];
|
||||
mp_mutex_unlock(&sub->lock);
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user