From 0db55cd86ad772195733419f09c91c50b8cce0f9 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 27 Dec 2012 21:19:33 +0100 Subject: stream_lavf: warn if protocol not found If ffmpeg returns AVERROR_PROTOCOL_NOT_FOUND, print a warning that ffmpeg should be compiled with network support. Note that stream_lavf.c itself includes a whitelist of directly supported ffmpeg protocols, so it can't happen that a completely unknown/madeup protocol triggers this message. (Unless the ffmpeg:// or lavf:// prefixes are used.) --- stream/stream_lavf.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'stream/stream_lavf.c') diff --git a/stream/stream_lavf.c b/stream/stream_lavf.c index 63c68b94df..0b540e26bc 100644 --- a/stream/stream_lavf.c +++ b/stream/stream_lavf.c @@ -137,8 +137,13 @@ static int open_f(stream_t *stream, int mode, void *opts, int *file_format) filename = talloc_asprintf(temp, "mmsh://%.*s", BSTR_P(b_filename)); } - if (avio_open(&avio, filename, flags) < 0) + int err = avio_open(&avio, filename, flags); + if (err < 0) { + if (err == AVERROR_PROTOCOL_NOT_FOUND) + mp_msg(MSGT_OPEN, MSGL_ERR, "[ffmpeg] Protocol not found. Make sure" + " ffmpeg/Libav is compiled with networking support.\n"); goto out; + } #if LIBAVFORMAT_VERSION_MICRO >= 100 if (avio->av_class) { -- cgit v1.2.3