[vlc-commits] Decklink: Simplify format mode logging

Marvin Scholz git at videolan.org
Mon Oct 22 19:09:02 CEST 2018


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

Decklink: Simplify format mode logging

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

 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