From 94f237473c98da4b8a4b821665c1b1325c03a6ef Mon Sep 17 00:00:00 2001
From: Tristan Matthews <tristan.matthews@savoirfairelinux.com>
Date: Fri, 10 Jan 2014 16:00:29 -0500
Subject: [PATCH] video_decoder: improve error message

---
 daemon/src/video/video_decoder.cpp | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/daemon/src/video/video_decoder.cpp b/daemon/src/video/video_decoder.cpp
index 3355343be5..2f4193b2ec 100644
--- a/daemon/src/video/video_decoder.cpp
+++ b/daemon/src/video/video_decoder.cpp
@@ -74,10 +74,15 @@ int VideoDecoder::openInput(const std::string &source_str,
 
     int ret = avformat_open_input(&inputCtx_, source_str.c_str(), iformat,
                                   options_ ? &options_ : NULL);
-    if (ret)
-        ERROR("avformat_open_input failed (%d)", ret);
 
-    DEBUG("Using format %s", format_str.c_str());
+    if (ret) {
+        char errbuf[64];
+        av_strerror(ret, errbuf, sizeof(errbuf));
+        ERROR("avformat_open_input failed: %s", errbuf);
+    } else {
+        DEBUG("Using format %s", format_str.c_str());
+    }
+
     return ret;
 }
 
-- 
GitLab