0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02: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:
Uoti Urpala 2010-12-09 02:50:17 +02:00
parent 102b240e96
commit cc2d748b73
3 changed files with 9 additions and 1 deletions

View File

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

View File

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

View File

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