comparison flacenc.c @ 4579:e5fca5c56cb2 libavformat

Add support for full header extradata to raw FLAC muxer.
author jbr
date Thu, 26 Feb 2009 02:32:18 +0000
parents c05d167a4fe2
children f9775a0b7fdb
comparison
equal deleted inserted replaced
4578:c05d167a4fe2 4579:e5fca5c56cb2
27 static const uint8_t header[8] = { 27 static const uint8_t header[8] = {
28 0x66, 0x4C, 0x61, 0x43, 0x80, 0x00, 0x00, 0x22 28 0x66, 0x4C, 0x61, 0x43, 0x80, 0x00, 0x00, 0x22
29 }; 29 };
30 AVCodecContext *codec = s->streams[0]->codec; 30 AVCodecContext *codec = s->streams[0]->codec;
31 uint8_t *streaminfo; 31 uint8_t *streaminfo;
32 int len = s->streams[0]->codec->extradata_size;
33 enum FLACExtradataFormat format; 32 enum FLACExtradataFormat format;
34 33
35 if (!ff_flac_is_extradata_valid(codec, &format, &streaminfo)) 34 if (!ff_flac_is_extradata_valid(codec, &format, &streaminfo))
36 return -1; 35 return -1;
37 36
38 if (format == FLAC_EXTRADATA_FORMAT_STREAMINFO) { 37 if (format == FLAC_EXTRADATA_FORMAT_STREAMINFO) {
39 put_buffer(s->pb, header, 8); 38 put_buffer(s->pb, header, 8);
40 put_buffer(s->pb, streaminfo, len);
41 } 39 }
40
41 /* write STREAMINFO or full header */
42 put_buffer(s->pb, codec->extradata, codec->extradata_size);
43
42 return 0; 44 return 0;
43 } 45 }
44 46
45 static int flac_write_trailer(struct AVFormatContext *s) 47 static int flac_write_trailer(struct AVFormatContext *s)
46 { 48 {