summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-12-27 21:19:33 +0100
committerwm4 <wm4@nowhere>2012-12-28 14:23:29 +0100
commit0db55cd86ad772195733419f09c91c50b8cce0f9 (patch)
tree7b0c0277dc9231a9f042c3da78bfcedc731bf24c /stream
parent973f34bb5666c6e69b76bb75fe3c1833136724cc (diff)
downloadmpv-0db55cd86ad772195733419f09c91c50b8cce0f9.tar.bz2
mpv-0db55cd86ad772195733419f09c91c50b8cce0f9.tar.xz
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.)
Diffstat (limited to 'stream')
-rw-r--r--stream/stream_lavf.c7
1 files changed, 6 insertions, 1 deletions
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) {