summaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2007-08-12 09:29:39 +0000
committerMichael Niedermayer <michaelni@gmx.at>2007-08-12 09:29:39 +0000
commit880e3ef41311c036892e4e0688e58418505886a3 (patch)
tree0e10d0990443a6fcca95293408b6d42ba5e84466 /libavformat
parent4e68cb8ac7fbd445a66976501ae13f8732b222ef (diff)
downloadffmpeg-streaming-880e3ef41311c036892e4e0688e58418505886a3.zip
ffmpeg-streaming-880e3ef41311c036892e4e0688e58418505886a3.tar.gz
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
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/ogg2.c1
-rw-r--r--libavformat/ogg2.h1
-rw-r--r--libavformat/oggparseflac.c16
3 files changed, 18 insertions, 0 deletions
diff --git a/libavformat/ogg2.c b/libavformat/ogg2.c
index 3602f21..2b4b160 100644
--- a/libavformat/ogg2.c
+++ b/libavformat/ogg2.c
@@ -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,
diff --git a/libavformat/ogg2.h b/libavformat/ogg2.h
index 6b7c6b2..1230787 100644
--- a/libavformat/ogg2.h
+++ b/libavformat/ogg2.h
@@ -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;
diff --git a/libavformat/oggparseflac.c b/libavformat/oggparseflac.c
index b2bdcd4..d8eff05 100644
--- a/libavformat/oggparseflac.c
+++ b/libavformat/oggparseflac.c
@@ -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
+};
OpenPOWER on IntegriCloud