]> git.sesse.net Git - ffmpeg/commitdiff
fix encoding of flac private data
authorJustin Ruggles <justin.ruggles@gmail.com>
Thu, 1 May 2008 22:04:17 +0000 (22:04 +0000)
committerJustin Ruggles <justin.ruggles@gmail.com>
Thu, 1 May 2008 22:04:17 +0000 (22:04 +0000)
Originally committed as revision 13030 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/matroskaenc.c

index f5729e48c692b319a7df3ed7304be123e529eef8..380ed32685a651e16a7ef01712aabe5d66421e9f 100644 (file)
@@ -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;