decoder/ffmpeg: pass MIME type to ffmpeg/libav version 11

That attribute was uninitialized before, which could crash
libavformat.

See Debian bug 760669
This commit is contained in:
Max Kellermann
2014-09-07 22:05:33 +02:00
parent e3a0f15837
commit 219c42522f
2 changed files with 8 additions and 0 deletions

View File

@@ -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);
}