aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2008-05-01 22:04:17 +0000
committerJustin Ruggles <justin.ruggles@gmail.com>2008-05-01 22:04:17 +0000
commit8a0684f4c4a0d4375907807034ad2fc27953f5d6 (patch)
treea25756fa1de1524fcfa1b2c83268bc151493d25a
parentbddbd7d3d185088bccfcafec79849d9707bb99a0 (diff)
downloadffmpeg-8a0684f4c4a0d4375907807034ad2fc27953f5d6.tar.gz
fix encoding of flac private data
Originally committed as revision 13030 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/matroskaenc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index f5729e48c6..380ed32685 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -429,9 +429,12 @@ static int put_flac_codecpriv(AVFormatContext *s, ByteIOContext *pb, AVCodecCont
return -1;
} else if (codec->extradata_size == FLAC_STREAMINFO_SIZE) {
// only the streaminfo packet
- put_byte(pb, 0);
- put_xiph_size(pb, codec->extradata_size);
- av_log(s, AV_LOG_ERROR, "Only one packet\n");
+ put_buffer(pb, "fLaC", 4);
+ put_byte(pb, 0x80);
+ put_be24(pb, FLAC_STREAMINFO_SIZE);
+ } else if(memcmp("fLaC", codec->extradata, 4)) {
+ av_log(s, AV_LOG_ERROR, "Invalid FLAC extradata\n");
+ return -1;
}
put_buffer(pb, codec->extradata, codec->extradata_size);
return 0;