[vlc-commits] Decklink: Simplify format mode logging

Marvin Scholz git at videolan.org
Mon Oct 22 18:47:20 CEST 2018


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Mon Oct 22 09:35:26 2018 +0200| [b13b3cf13c77fecf022ae542409ade4090065dcc] | committer: Marvin Scholz

Decklink: Simplify format mode logging

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b13b3cf13c77fecf022ae542409ade4090065dcc
---

 modules/access/decklink.cpp | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/modules/access/decklink.cpp b/modules/access/decklink.cpp
index 02b321d0da..46ddebfb46 100644
--- a/modules/access/decklink.cpp
+++ b/modules/access/decklink.cpp
@@ -262,15 +262,14 @@ public:
             return S_OK;
 
         decklink_str_t tmp_name;
-        char *mode_name;
-        if (mode->GetName(&tmp_name) != S_OK) {
-            mode_name = strdup("unknown");
-        } else {
+        char *mode_name = NULL;
+        if (mode->GetName(&tmp_name) == S_OK) {
             mode_name = DECKLINK_STRDUP(tmp_name);
             DECKLINK_FREE(tmp_name);
         }
 
-        msg_Dbg(demux_, "Video input format changed to %s", mode_name);
+        msg_Dbg(demux_, "Video input format changed to %s",
+            (mode_name) ? mode_name : "unknown");
         free(mode_name);
         if (!sys->autodetect) {
             msg_Err(demux_, "Video format detection disabled");



More information about the vlc-commits mailing list