diff mbox series

[FFmpeg-devel,2.9/3] libavformat/protocols.c: avio_enum_protocols(): Reverse the conditional

Message ID 4123b175895d4cee80b6f0df3fe91b3e@gmail.com
State New
Headers show
Series [FFmpeg-devel,2.1/3] libavformat/protocols.c: avio_enum_protocols(): Split declaration and initialization | expand

Checks

Context Check Description
andriy/configure warning Failed to apply patch

Commit Message

Michael Witten Aug. 11, 2021, 7 p.m. UTC
The 'if(!*p)' has been turned into 'if (*p)'; of course,
this has necessitated the swapping of the branches.

---
 libavformat/protocols.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/protocols.c b/libavformat/protocols.c
index 5828113428..0deadbfbe7 100644
--- a/libavformat/protocols.c
+++ b/libavformat/protocols.c
@@ -96,14 +96,14 @@  const char *avio_enum_protocols(void **const opaque, const int output)
     typedef const URLProtocol *const *Iterator;
     Iterator p = *opaque ? (Iterator)(*opaque) + 1 : url_protocols;
 iterate:
-    if (!*p) {
-        *opaque = NULL;
-        return NULL;
-    } else {
+    if (*p) {
         if ((output && (*p)->url_write) || (!output && (*p)->url_read)) {
             *opaque = (void *)p;
             return (*p)->name;
         }
+    } else {
+        *opaque = NULL;
+        return NULL;
     }
     ++p;
     goto iterate;