mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-04-30 13:50:50 +08:00
Use AVOnce as a static variable consistently
Using AVOnce as a stack variable makes no sense as the state is lost when the function exits. This fixes repeated calls to av(filter/device)_register_all
This commit is contained in:
@@ -73,7 +73,7 @@ static void register_all(void)
|
||||
|
||||
void avdevice_register_all(void)
|
||||
{
|
||||
AVOnce control = AV_ONCE_INIT;
|
||||
static AVOnce control = AV_ONCE_INIT;
|
||||
|
||||
ff_thread_once(&control, register_all);
|
||||
}
|
||||
|
||||
@@ -381,7 +381,7 @@ static void register_all(void)
|
||||
|
||||
void avfilter_register_all(void)
|
||||
{
|
||||
AVOnce control = AV_ONCE_INIT;
|
||||
static AVOnce control = AV_ONCE_INIT;
|
||||
|
||||
ff_thread_once(&control, register_all);
|
||||
}
|
||||
|
||||
@@ -384,7 +384,7 @@ static void register_all(void)
|
||||
|
||||
void av_register_all(void)
|
||||
{
|
||||
AVOnce control = AV_ONCE_INIT;
|
||||
static AVOnce control = AV_ONCE_INIT;
|
||||
|
||||
ff_thread_once(&control, register_all);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user