mirror of
https://github.com/mpv-player/mpv
synced 2025-03-20 18:28:01 +00:00
audio: FLAC: support new libavcodec parser, use lavf to demux
Parse FLAC data with new libavcodec parser if needed. Use libavformat demuxer for raw FLAC files by default.
This commit is contained in:
parent
102b240e96
commit
cc2d748b73
@ -491,6 +491,7 @@ static int demux_audio_open(demuxer_t* demuxer) {
|
||||
}
|
||||
if (sh_audio->i_bps < 1) // guess value to prevent crash
|
||||
sh_audio->i_bps = 64 * 1024;
|
||||
sh_audio->needs_parsing = 1;
|
||||
// get_flac_metadata (demuxer);
|
||||
break;
|
||||
}
|
||||
|
@ -234,8 +234,12 @@ static const char * const preferred_internal[] = {
|
||||
/* lavf Matroska demuxer doesn't support ordered chapters and fails
|
||||
* for more files */
|
||||
"matroska",
|
||||
/* seeking won't work in lavf FLAC demuxer until a parser is committed */
|
||||
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(52, 99, 0)
|
||||
/* Seeking doesn't work with lavf FLAC demuxer in FFmpeg versions
|
||||
* without a FLAC parser. In principle this could use a runtime check to
|
||||
* switch if a shared library is updated. */
|
||||
"flac",
|
||||
#endif
|
||||
/* lavf gives neither pts nor dts for some video frames in .rm */
|
||||
"rm",
|
||||
NULL
|
||||
|
@ -464,6 +464,9 @@ static void allocate_parser(AVCodecContext **avctx, AVCodecParserContext **parse
|
||||
case 0x86:
|
||||
codec_id = CODEC_ID_DTS;
|
||||
break;
|
||||
case MKTAG('f', 'L', 'a', 'C'):
|
||||
codec_id = CODEC_ID_FLAC;
|
||||
break;
|
||||
case MKTAG('M', 'L', 'P', ' '):
|
||||
codec_id = CODEC_ID_MLP;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user