mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-08-24 02:34:23 -05:00
deps/media-playback: Initialize mutex earlier for cached media
mp_cache_stop / mp_cache_free both try to use the mutex so we need to make sure it's initialized before calling functions that may fail.
This commit is contained in:
+3
-1
@@ -560,6 +560,9 @@ bool mp_cache_init(mp_cache_t *c, const struct mp_media_info *info)
|
||||
info2.full_decode = true;
|
||||
|
||||
mp_media_t *m = &c->m;
|
||||
|
||||
pthread_mutex_init_value(&c->mutex);
|
||||
|
||||
if (!mp_media_init(m, &info2)) {
|
||||
mp_cache_free(c);
|
||||
return false;
|
||||
@@ -569,7 +572,6 @@ bool mp_cache_init(mp_cache_t *c, const struct mp_media_info *info)
|
||||
return false;
|
||||
}
|
||||
|
||||
pthread_mutex_init_value(&c->mutex);
|
||||
c->opaque = info->opaque;
|
||||
c->v_cb = info->v_cb;
|
||||
c->a_cb = info->a_cb;
|
||||
|
||||
Reference in New Issue
Block a user