[FFmpeg-devel] [PATCH 2.1/3] libavformat/protocols.c: avio_enum_protocols(): Split declaration and initialization
Michael Witten
mfwitten at gmail.com
Wed Aug 11 22:00:03 EEST 2021
The main purpose of doing this is to allow for inserting a
a statement label; as I recall, a label cannot be placed
just before a declaration, even when that declaration has
an initializer (then again, I never tried, so maybe this
is not true...)
---
libavformat/protocols.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libavformat/protocols.c b/libavformat/protocols.c
index e671c5ab6a..1c5e3b2bdb 100644
--- a/libavformat/protocols.c
+++ b/libavformat/protocols.c
@@ -93,8 +93,9 @@ const AVClass *ff_urlcontext_child_class_iterate(void **iter)
const char *avio_enum_protocols(void **const opaque, const int output)
{
- const URLProtocol *const *p = *opaque;
+ const URLProtocol *const *p;
+ p = *opaque;
p = p ? p + 1 : url_protocols;
*opaque = (void *)p;
if (!*p) {
--
2.22.0
More information about the ffmpeg-devel
mailing list