1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02: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:
Hendrik Leppkes 2017-05-22 12:00:23 +02:00
parent 49d0678181
commit 9fb293cfd8
3 changed files with 3 additions and 3 deletions

View File

@ -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);
}

View File

@ -390,7 +390,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);
}

View File

@ -385,7 +385,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);
}