Browse Source

add support for old flac in ogg

fixes samples.mplayerhq.hu/flac/Yesterday.ogg
closes issue73

Originally committed as revision 10088 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Michael Niedermayer 18 years ago
parent
commit
880e3ef413
3 changed files with 18 additions and 0 deletions
  1. +1
    -0
      libavformat/ogg2.c
  2. +1
    -0
      libavformat/ogg2.h
  3. +16
    -0
      libavformat/oggparseflac.c

+ 1
- 0
libavformat/ogg2.c View File

@@ -41,6 +41,7 @@ static ogg_codec_t *ogg_codecs[] = {
&vorbis_codec,
&theora_codec,
&flac_codec,
&old_flac_codec,
&ogm_video_codec,
&ogm_audio_codec,
&ogm_old_codec,


+ 1
- 0
libavformat/ogg2.h View File

@@ -77,6 +77,7 @@ typedef struct ogg {
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;


+ 16
- 0
libavformat/oggparseflac.c View File

@@ -75,8 +75,24 @@ flac_header (AVFormatContext * s, int idx)
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
};

Loading…
Cancel
Save