comparison raw.c @ 686:e2687b784c3a libavformat

shorten decoder by (Jeff Muizelaar <jrmuizel gmail com>)
author michael
date Sat, 26 Feb 2005 03:36:04 +0000
parents 76e36d97a27a
children af4e24d6310c
comparison
equal deleted inserted replaced
685:4b339414d338 686:e2687b784c3a
186 st->need_parsing = 1; 186 st->need_parsing = 1;
187 /* the parameters will be extracted from the compressed bitstream */ 187 /* the parameters will be extracted from the compressed bitstream */
188 return 0; 188 return 0;
189 } 189 }
190 190
191 static int shorten_read_header(AVFormatContext *s,
192 AVFormatParameters *ap)
193 {
194 AVStream *st;
195
196 st = av_new_stream(s, 0);
197 if (!st)
198 return AVERROR_NOMEM;
199 st->codec.codec_type = CODEC_TYPE_AUDIO;
200 st->codec.codec_id = CODEC_ID_SHORTEN;
201 st->need_parsing = 1;
202 /* the parameters will be extracted from the compressed bitstream */
203 return 0;
204 }
205
191 /* dts read */ 206 /* dts read */
192 static int dts_read_header(AVFormatContext *s, 207 static int dts_read_header(AVFormatContext *s,
193 AVFormatParameters *ap) 208 AVFormatParameters *ap)
194 { 209 {
195 AVStream *st; 210 AVStream *st;
292 if (code == 0x10) { 307 if (code == 0x10) {
293 return 50; 308 return 50;
294 } 309 }
295 return 0; 310 return 0;
296 } 311 }
312
313 AVInputFormat shorten_iformat = {
314 "shn",
315 "raw shn",
316 0,
317 NULL,
318 shorten_read_header,
319 raw_read_partial_packet,
320 raw_read_close,
321 .extensions = "shn",
322 };
297 323
298 AVInputFormat ac3_iformat = { 324 AVInputFormat ac3_iformat = {
299 "ac3", 325 "ac3",
300 "raw ac3", 326 "raw ac3",
301 0, 327 0,
670 #define av_register_input_format(format) 696 #define av_register_input_format(format)
671 #endif 697 #endif
672 698
673 int raw_init(void) 699 int raw_init(void)
674 { 700 {
701
702 av_register_input_format(&shorten_iformat);
703
675 av_register_input_format(&ac3_iformat); 704 av_register_input_format(&ac3_iformat);
676 av_register_output_format(&ac3_oformat); 705 av_register_output_format(&ac3_oformat);
677 706
678 av_register_input_format(&dts_iformat); 707 av_register_input_format(&dts_iformat);
679 708