Mercurial > libavformat.hg
diff matroskaenc.c @ 3271:c702c1c5b890 libavformat
fix encoding of flac private data
author | jbr |
---|---|
date | Thu, 01 May 2008 22:04:17 +0000 |
parents | 1a16b069daca |
children | 6f61c3b36632 |
line wrap: on
line diff
--- a/matroskaenc.c Tue Apr 29 00:12:49 2008 +0000 +++ b/matroskaenc.c Thu May 01 22:04:17 2008 +0000 @@ -429,9 +429,12 @@ 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;