aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-09-07 22:05:33 +0200
committerMax Kellermann <max@duempel.org>2014-09-07 22:05:33 +0200
commit219c42522f938c5fff08d962a1a54c0872322f00 (patch)
tree79bb802f688e0df73ff09204a923cfeb9a17c680
parente3a0f158376a38abb2eb9aa4a67b155ff9da6ffe (diff)
downloadmpd-219c42522f938c5fff08d962a1a54c0872322f00.tar.gz
mpd-219c42522f938c5fff08d962a1a54c0872322f00.tar.xz
mpd-219c42522f938c5fff08d962a1a54c0872322f00.zip
decoder/ffmpeg: pass MIME type to ffmpeg/libav version 11
That attribute was uninitialized before, which could crash libavformat. See Debian bug 760669
Diffstat (limited to '')
-rw-r--r--NEWS1
-rw-r--r--src/decoder/FfmpegDecoderPlugin.cxx7
2 files changed, 8 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index d5612bfdc..d0fb64623 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ ver 0.18.14 (not yet released)
- fix range parser bug on certain 32 bit architectures
* decoder
- audiofile: fix crash after seeking
+ - ffmpeg: fix crash with ffmpeg/libav version 11
- fix assertion failure after seeking
ver 0.18.13 (2014/08/31)
diff --git a/src/decoder/FfmpegDecoderPlugin.cxx b/src/decoder/FfmpegDecoderPlugin.cxx
index 5133f91ac..1409a3c47 100644
--- a/src/decoder/FfmpegDecoderPlugin.cxx
+++ b/src/decoder/FfmpegDecoderPlugin.cxx
@@ -387,6 +387,13 @@ ffmpeg_probe(Decoder *decoder, InputStream &is)
avpd.buf_size = nbytes;
avpd.filename = is.uri.c_str();
+#ifdef AVPROBE_SCORE_MIME
+ /* this attribute was added in libav/ffmpeg version 11, but
+ unfortunately it's "uint8_t" instead of "char", and it's
+ not "const" - wtf? */
+ avpd.mime_type = (uint8_t *)const_cast<char *>(is.GetMimeType());
+#endif
+
return av_probe_input_format(&avpd, true);
}