mirror of https://github.com/mpv-player/mpv
demux_lavf: always give libavformat the filename when probing
This gives the filename or URL to the libavformat probing logic, which might use the file extension as a "help" to decide which format the file is. This helps with mp3 files that have large id3v2 tags and prevents the idiotic ffmpeg probing logic to think that a mp3 file is amr. (What we really want is knowing whether we _really_ need to feed more data to libavformat to detect the format. And without having to pre-read excessive amounts of data for relatively normal streams.)
This commit is contained in:
parent
41cefe3e1f
commit
41243e7c4f
|
@ -403,7 +403,7 @@ static int lavf_check_file(demuxer_t *demuxer, enum demux_check check)
|
||||||
|
|
||||||
AVProbeData avpd = {
|
AVProbeData avpd = {
|
||||||
// Disable file-extension matching with normal checks
|
// Disable file-extension matching with normal checks
|
||||||
.filename = check <= DEMUX_CHECK_REQUEST ? priv->filename : "",
|
.filename = priv->filename,
|
||||||
.buf_size = 0,
|
.buf_size = 0,
|
||||||
.buf = av_mallocz(PROBE_BUF_SIZE + AV_INPUT_BUFFER_PADDING_SIZE),
|
.buf = av_mallocz(PROBE_BUF_SIZE + AV_INPUT_BUFFER_PADDING_SIZE),
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue