Browse Source

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
tags/n3.4
Hendrik Leppkes 8 years ago
parent
commit
9fb293cfd8
3 changed files with 3 additions and 3 deletions
  1. +1
    -1
      libavdevice/alldevices.c
  2. +1
    -1
      libavfilter/allfilters.c
  3. +1
    -1
      libavformat/allformats.c

+ 1
- 1
libavdevice/alldevices.c 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);
}

+ 1
- 1
libavfilter/allfilters.c 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);
}

+ 1
- 1
libavformat/allformats.c 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);
}

Loading…
Cancel
Save