From 9fb293cfd8b758b98f1f535a2867c7bf3a324af6 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Mon, 22 May 2017 12:00:23 +0200 Subject: 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 --- libavdevice/alldevices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavdevice/alldevices.c') diff --git a/libavdevice/alldevices.c b/libavdevice/alldevices.c index 280a260bd3..a8ed53ae5d 100644 --- a/libavdevice/alldevices.c +++ b/libavdevice/alldevices.c @@ -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); } -- cgit v1.2.3