From 67f4db2771bedf4541e836b4aac3c2f36004dd4d Mon Sep 17 00:00:00 2001 From: Petri Hintukainen Date: Thu, 7 Nov 2013 10:28:40 +0200 Subject: avformat: be more verbose if opening input fails --- src/combined/ffmpeg/demux_avformat.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/combined/ffmpeg/demux_avformat.c b/src/combined/ffmpeg/demux_avformat.c index 3958a4049..08a163620 100644 --- a/src/combined/ffmpeg/demux_avformat.c +++ b/src/combined/ffmpeg/demux_avformat.c @@ -168,9 +168,15 @@ static input_plugin_t *input_avformat_get_instance (input_class_t *cls_gen, xine /* open input file, and allocate format context */ AVFormatContext *fmt_ctx = NULL; + int error; - if (avformat_open_input(&fmt_ctx, real_mrl ? real_mrl : mrl, NULL, &options) < 0) { - xprintf (stream->xine, XINE_VERBOSITY_LOG, LOG_MODULE": Could not open source '%s'\n", mrl); + if ((error = avformat_open_input(&fmt_ctx, real_mrl ? real_mrl : mrl, NULL, &options)) < 0) { + char buf[80] = ""; + if (!av_strerror(error, buf, sizeof(buf))) { + xprintf (stream->xine, XINE_VERBOSITY_LOG, LOG_MODULE": Could not open source '%s': %s\n", mrl, buf); + } else { + xprintf (stream->xine, XINE_VERBOSITY_LOG, LOG_MODULE": Could not open source '%s'\n", mrl); + } free(real_mrl); return NULL; } -- cgit v1.2.3