1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-11 08:37:59 +00:00

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.)
This commit is contained in:
wm4 2012-12-27 21:19:33 +01:00
parent 973f34bb56
commit 0db55cd86a

View File

@ -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) {