comparison raw.c @ 1070:26d75e74c7b7 libavformat

Add support for raw flac decoding based on the .flac suffix of input files.
author banan
date Tue, 09 May 2006 12:34:35 +0000
parents 2d57ce58f576
children 0bc9422cc0ad
comparison
equal deleted inserted replaced
1069:21c0614314aa 1070:26d75e74c7b7
234 st->need_parsing = 1; 234 st->need_parsing = 1;
235 /* the parameters will be extracted from the compressed bitstream */ 235 /* the parameters will be extracted from the compressed bitstream */
236 return 0; 236 return 0;
237 } 237 }
238 238
239 /* flac read */
240 static int flac_read_header(AVFormatContext *s,
241 AVFormatParameters *ap)
242 {
243 AVStream *st;
244
245 st = av_new_stream(s, 0);
246 if (!st)
247 return AVERROR_NOMEM;
248 st->codec->codec_type = CODEC_TYPE_AUDIO;
249 st->codec->codec_id = CODEC_ID_FLAC;
250 st->need_parsing = 1;
251 /* the parameters will be extracted from the compressed bitstream */
252 return 0;
253 }
254
239 /* dts read */ 255 /* dts read */
240 static int dts_read_header(AVFormatContext *s, 256 static int dts_read_header(AVFormatContext *s,
241 AVFormatParameters *ap) 257 AVFormatParameters *ap)
242 { 258 {
243 AVStream *st; 259 AVStream *st;
368 raw_read_partial_packet, 384 raw_read_partial_packet,
369 raw_read_close, 385 raw_read_close,
370 .extensions = "shn", 386 .extensions = "shn",
371 }; 387 };
372 388
389 AVInputFormat flac_iformat = {
390 "flac",
391 "raw flac",
392 0,
393 NULL,
394 flac_read_header,
395 raw_read_partial_packet,
396 raw_read_close,
397 .extensions = "flac",
398 };
399
373 AVInputFormat ac3_iformat = { 400 AVInputFormat ac3_iformat = {
374 "ac3", 401 "ac3",
375 "raw ac3", 402 "raw ac3",
376 0, 403 0,
377 NULL, 404 NULL,
762 789
763 int raw_init(void) 790 int raw_init(void)
764 { 791 {
765 792
766 av_register_input_format(&shorten_iformat); 793 av_register_input_format(&shorten_iformat);
794 av_register_input_format(&flac_iformat);
767 795
768 av_register_input_format(&ac3_iformat); 796 av_register_input_format(&ac3_iformat);
769 av_register_output_format(&ac3_oformat); 797 av_register_output_format(&ac3_oformat);
770 798
771 av_register_input_format(&aac_iformat); 799 av_register_input_format(&aac_iformat);