# HG changeset patch # User michael # Date 1186910979 0 # Node ID 214978878a19a5920e8518f486f9212f8301f6b7 # Parent 2a44e9c75bf37846a14c11d31e12c3e5a4e4d256 add support for old flac in ogg fixes samples.mplayerhq.hu/flac/Yesterday.ogg closes issue73 diff -r 2a44e9c75bf3 -r 214978878a19 ogg2.c --- a/ogg2.c Sun Aug 12 00:23:47 2007 +0000 +++ b/ogg2.c Sun Aug 12 09:29:39 2007 +0000 @@ -41,6 +41,7 @@ &vorbis_codec, &theora_codec, &flac_codec, + &old_flac_codec, &ogm_video_codec, &ogm_audio_codec, &ogm_old_codec, diff -r 2a44e9c75bf3 -r 214978878a19 ogg2.h --- a/ogg2.h Sun Aug 12 00:23:47 2007 +0000 +++ b/ogg2.h Sun Aug 12 09:29:39 2007 +0000 @@ -77,6 +77,7 @@ extern ogg_codec_t vorbis_codec; extern ogg_codec_t theora_codec; extern ogg_codec_t flac_codec; +extern ogg_codec_t old_flac_codec; extern ogg_codec_t ogm_video_codec; extern ogg_codec_t ogm_audio_codec; extern ogg_codec_t ogm_old_codec; diff -r 2a44e9c75bf3 -r 214978878a19 oggparseflac.c --- a/oggparseflac.c Sun Aug 12 00:23:47 2007 +0000 +++ b/oggparseflac.c Sun Aug 12 09:29:39 2007 +0000 @@ -75,8 +75,24 @@ return 1; } +static int +old_flac_header (AVFormatContext * s, int idx) +{ + AVStream *st = s->streams[idx]; + st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_id = CODEC_ID_FLAC; + + return 0; +} + ogg_codec_t flac_codec = { .magic = "\177FLAC", .magicsize = 5, .header = flac_header }; + +ogg_codec_t old_flac_codec = { + .magic = "fLaC", + .magicsize = 4, + .header = old_flac_header +};