Mercurial > libavformat.hg
comparison au.c @ 277:a313e1080322 libavformat
disable encoders where appropriate (patch courtesy of BERO
<bero -at- geocities.co.jp>)
author | melanson |
---|---|
date | Tue, 14 Oct 2003 04:15:53 +0000 |
parents | 3d92f793fd67 |
children | e7a8d4dd8e14 |
comparison
equal
deleted
inserted
replaced
276:3dd3646e0164 | 277:a313e1080322 |
---|---|
37 { CODEC_ID_PCM_S16BE, 3 }, | 37 { CODEC_ID_PCM_S16BE, 3 }, |
38 { CODEC_ID_PCM_ALAW, 27 }, | 38 { CODEC_ID_PCM_ALAW, 27 }, |
39 { 0, 0 }, | 39 { 0, 0 }, |
40 }; | 40 }; |
41 | 41 |
42 #ifdef CONFIG_ENCODERS | |
42 /* AUDIO_FILE header */ | 43 /* AUDIO_FILE header */ |
43 static int put_au_header(ByteIOContext *pb, AVCodecContext *enc) | 44 static int put_au_header(ByteIOContext *pb, AVCodecContext *enc) |
44 { | 45 { |
45 if(!enc->codec_tag) | 46 if(!enc->codec_tag) |
46 enc->codec_tag = codec_get_tag(codec_au_tags, enc->codec_id); | 47 enc->codec_tag = codec_get_tag(codec_au_tags, enc->codec_id); |
95 put_flush_packet(pb); | 96 put_flush_packet(pb); |
96 } | 97 } |
97 | 98 |
98 return 0; | 99 return 0; |
99 } | 100 } |
101 #endif //CONFIG_ENCODERS | |
100 | 102 |
101 static int au_probe(AVProbeData *p) | 103 static int au_probe(AVProbeData *p) |
102 { | 104 { |
103 /* check file header */ | 105 /* check file header */ |
104 if (p->buf_size <= 24) | 106 if (p->buf_size <= 24) |
185 au_read_header, | 187 au_read_header, |
186 au_read_packet, | 188 au_read_packet, |
187 au_read_close, | 189 au_read_close, |
188 }; | 190 }; |
189 | 191 |
192 #ifdef CONFIG_ENCODERS | |
190 static AVOutputFormat au_oformat = { | 193 static AVOutputFormat au_oformat = { |
191 "au", | 194 "au", |
192 "SUN AU Format", | 195 "SUN AU Format", |
193 "audio/basic", | 196 "audio/basic", |
194 "au", | 197 "au", |
197 CODEC_ID_NONE, | 200 CODEC_ID_NONE, |
198 au_write_header, | 201 au_write_header, |
199 au_write_packet, | 202 au_write_packet, |
200 au_write_trailer, | 203 au_write_trailer, |
201 }; | 204 }; |
205 #endif //CONFIG_ENCODERS | |
202 | 206 |
203 int au_init(void) | 207 int au_init(void) |
204 { | 208 { |
205 av_register_input_format(&au_iformat); | 209 av_register_input_format(&au_iformat); |
210 #ifdef CONFIG_ENCODERS | |
206 av_register_output_format(&au_oformat); | 211 av_register_output_format(&au_oformat); |
207 return 0; | 212 #endif //CONFIG_ENCODERS |
208 } | 213 return 0; |
214 } |