comparison ffm.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 54e915169d48
comparison
equal deleted inserted replaced
276:3dd3646e0164 277:a313e1080322
52 } FFMContext; 52 } FFMContext;
53 53
54 /* disable pts hack for testing */ 54 /* disable pts hack for testing */
55 int ffm_nopts = 0; 55 int ffm_nopts = 0;
56 56
57 #ifdef CONFIG_ENCODERS
57 static void flush_packet(AVFormatContext *s) 58 static void flush_packet(AVFormatContext *s)
58 { 59 {
59 FFMContext *ffm = s->priv_data; 60 FFMContext *ffm = s->priv_data;
60 int fill_size, h; 61 int fill_size, h;
61 ByteIOContext *pb = &s->pb; 62 ByteIOContext *pb = &s->pb;
271 272
272 for(i=0;i<s->nb_streams;i++) 273 for(i=0;i<s->nb_streams;i++)
273 av_freep(&s->streams[i]->priv_data); 274 av_freep(&s->streams[i]->priv_data);
274 return 0; 275 return 0;
275 } 276 }
277 #endif //CONFIG_ENCODERS
276 278
277 /* ffm demux */ 279 /* ffm demux */
278 280
279 static int ffm_is_avail_data(AVFormatContext *s, int size) 281 static int ffm_is_avail_data(AVFormatContext *s, int size)
280 { 282 {
661 ffm_read_packet, 663 ffm_read_packet,
662 ffm_read_close, 664 ffm_read_close,
663 ffm_seek, 665 ffm_seek,
664 }; 666 };
665 667
668 #ifdef CONFIG_ENCODERS
666 static AVOutputFormat ffm_oformat = { 669 static AVOutputFormat ffm_oformat = {
667 "ffm", 670 "ffm",
668 "ffm format", 671 "ffm format",
669 "", 672 "",
670 "ffm", 673 "ffm",
674 CODEC_ID_MPEG1VIDEO, 677 CODEC_ID_MPEG1VIDEO,
675 ffm_write_header, 678 ffm_write_header,
676 ffm_write_packet, 679 ffm_write_packet,
677 ffm_write_trailer, 680 ffm_write_trailer,
678 }; 681 };
682 #endif //CONFIG_ENCODERS
679 683
680 int ffm_init(void) 684 int ffm_init(void)
681 { 685 {
682 av_register_input_format(&ffm_iformat); 686 av_register_input_format(&ffm_iformat);
687 #ifdef CONFIG_ENCODERS
683 av_register_output_format(&ffm_oformat); 688 av_register_output_format(&ffm_oformat);
684 return 0; 689 #endif //CONFIG_ENCODERS
685 } 690 return 0;
691 }