Commit 6c77805f authored by Michael Niedermayer's avatar Michael Niedermayer

get rid of the [4] limitation of codec tag lists

Originally committed as revision 7596 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 5484dad7
...@@ -417,7 +417,7 @@ AVInputFormat aiff_demuxer = { ...@@ -417,7 +417,7 @@ AVInputFormat aiff_demuxer = {
aiff_read_packet, aiff_read_packet,
aiff_read_close, aiff_read_close,
aiff_read_seek, aiff_read_seek,
.codec_tag= {codec_aiff_tags}, .codec_tag= (const AVCodecTag*[]){codec_aiff_tags, 0},
}; };
#endif #endif
...@@ -433,6 +433,6 @@ AVOutputFormat aiff_muxer = { ...@@ -433,6 +433,6 @@ AVOutputFormat aiff_muxer = {
aiff_write_header, aiff_write_header,
aiff_write_packet, aiff_write_packet,
aiff_write_trailer, aiff_write_trailer,
.codec_tag= {codec_aiff_tags}, .codec_tag= (const AVCodecTag*[]){codec_aiff_tags, 0},
}; };
#endif #endif
...@@ -849,7 +849,7 @@ AVOutputFormat asf_muxer = { ...@@ -849,7 +849,7 @@ AVOutputFormat asf_muxer = {
asf_write_packet, asf_write_packet,
asf_write_trailer, asf_write_trailer,
.flags = AVFMT_GLOBALHEADER, .flags = AVFMT_GLOBALHEADER,
.codec_tag= {codec_asf_bmp_tags, codec_bmp_tags, codec_wav_tags}, .codec_tag= (const AVCodecTag*[]){codec_asf_bmp_tags, codec_bmp_tags, codec_wav_tags, 0},
}; };
#endif #endif
...@@ -870,6 +870,6 @@ AVOutputFormat asf_stream_muxer = { ...@@ -870,6 +870,6 @@ AVOutputFormat asf_stream_muxer = {
asf_write_packet, asf_write_packet,
asf_write_trailer, asf_write_trailer,
.flags = AVFMT_GLOBALHEADER, .flags = AVFMT_GLOBALHEADER,
.codec_tag= {codec_asf_bmp_tags, codec_bmp_tags, codec_wav_tags}, .codec_tag= (const AVCodecTag*[]){codec_asf_bmp_tags, codec_bmp_tags, codec_wav_tags, 0},
}; };
#endif //CONFIG_ASF_STREAM_MUXER #endif //CONFIG_ASF_STREAM_MUXER
...@@ -190,7 +190,7 @@ AVInputFormat au_demuxer = { ...@@ -190,7 +190,7 @@ AVInputFormat au_demuxer = {
au_read_packet, au_read_packet,
au_read_close, au_read_close,
pcm_read_seek, pcm_read_seek,
.codec_tag= {codec_au_tags}, .codec_tag= (const AVCodecTag*[]){codec_au_tags, 0},
}; };
#endif #endif
...@@ -206,6 +206,6 @@ AVOutputFormat au_muxer = { ...@@ -206,6 +206,6 @@ AVOutputFormat au_muxer = {
au_write_header, au_write_header,
au_write_packet, au_write_packet,
au_write_trailer, au_write_trailer,
.codec_tag= {codec_au_tags}, .codec_tag= (const AVCodecTag*[]){codec_au_tags, 0},
}; };
#endif //CONFIG_AU_MUXER #endif //CONFIG_AU_MUXER
...@@ -162,7 +162,7 @@ typedef struct AVOutputFormat { ...@@ -162,7 +162,7 @@ typedef struct AVOutputFormat {
* list of supported codec_id-codec_tag pairs, ordered by "better choice first" * list of supported codec_id-codec_tag pairs, ordered by "better choice first"
* the arrays are all CODEC_ID_NONE terminated * the arrays are all CODEC_ID_NONE terminated
*/ */
const struct AVCodecTag *codec_tag[4]; const struct AVCodecTag **codec_tag;
/* private fields */ /* private fields */
struct AVOutputFormat *next; struct AVOutputFormat *next;
...@@ -219,7 +219,7 @@ typedef struct AVInputFormat { ...@@ -219,7 +219,7 @@ typedef struct AVInputFormat {
(RTSP) */ (RTSP) */
int (*read_pause)(struct AVFormatContext *); int (*read_pause)(struct AVFormatContext *);
const struct AVCodecTag *codec_tag[4]; const struct AVCodecTag **codec_tag;
/* private fields */ /* private fields */
struct AVInputFormat *next; struct AVInputFormat *next;
...@@ -408,8 +408,8 @@ void av_pkt_dump(FILE *f, AVPacket *pkt, int dump_payload); ...@@ -408,8 +408,8 @@ void av_pkt_dump(FILE *f, AVPacket *pkt, int dump_payload);
void av_register_all(void); void av_register_all(void);
/* codec tag <-> codec id */ /* codec tag <-> codec id */
enum CodecID av_codec_get_id(const struct AVCodecTag *tags[4], unsigned int tag); enum CodecID av_codec_get_id(const struct AVCodecTag **tags, unsigned int tag);
unsigned int av_codec_get_tag(const struct AVCodecTag *tags[4], enum CodecID id); unsigned int av_codec_get_tag(const struct AVCodecTag **tags, enum CodecID id);
/* media file input */ /* media file input */
AVInputFormat *av_find_input_format(const char *short_name); AVInputFormat *av_find_input_format(const char *short_name);
......
...@@ -575,6 +575,6 @@ AVOutputFormat avi_muxer = { ...@@ -575,6 +575,6 @@ AVOutputFormat avi_muxer = {
avi_write_header, avi_write_header,
avi_write_packet, avi_write_packet,
avi_write_trailer, avi_write_trailer,
.codec_tag= {codec_bmp_tags, codec_wav_tags}, .codec_tag= (const AVCodecTag*[]){codec_bmp_tags, codec_wav_tags, 0},
}; };
#endif //CONFIG_AVI_MUXER #endif //CONFIG_AVI_MUXER
...@@ -332,5 +332,5 @@ AVOutputFormat flv_muxer = { ...@@ -332,5 +332,5 @@ AVOutputFormat flv_muxer = {
flv_write_header, flv_write_header,
flv_write_packet, flv_write_packet,
flv_write_trailer, flv_write_trailer,
.codec_tag= {flv_video_codec_ids, flv_audio_codec_ids}, .codec_tag= (const AVCodecTag*[]){flv_video_codec_ids, flv_audio_codec_ids, 0},
}; };
...@@ -233,7 +233,7 @@ enum CodecID codec_get_id(const AVCodecTag *tags, unsigned int tag) ...@@ -233,7 +233,7 @@ enum CodecID codec_get_id(const AVCodecTag *tags, unsigned int tag)
unsigned int av_codec_get_tag(const AVCodecTag *tags[4], enum CodecID id) unsigned int av_codec_get_tag(const AVCodecTag *tags[4], enum CodecID id)
{ {
int i; int i;
for(i=0; i<4 && tags[i]; i++){ for(i=0; tags && tags[i]; i++){
int tag= codec_get_tag(tags[i], id); int tag= codec_get_tag(tags[i], id);
if(tag) return tag; if(tag) return tag;
} }
...@@ -243,7 +243,7 @@ unsigned int av_codec_get_tag(const AVCodecTag *tags[4], enum CodecID id) ...@@ -243,7 +243,7 @@ unsigned int av_codec_get_tag(const AVCodecTag *tags[4], enum CodecID id)
enum CodecID av_codec_get_id(const AVCodecTag *tags[4], unsigned int tag) enum CodecID av_codec_get_id(const AVCodecTag *tags[4], unsigned int tag)
{ {
int i; int i;
for(i=0; i<4 && tags[i]; i++){ for(i=0; tags && tags[i]; i++){
enum CodecID id= codec_get_id(tags[i], tag); enum CodecID id= codec_get_id(tags[i], tag);
if(id!=CODEC_ID_NONE) return id; if(id!=CODEC_ID_NONE) return id;
} }
......
...@@ -152,5 +152,5 @@ AVInputFormat voc_demuxer = { ...@@ -152,5 +152,5 @@ AVInputFormat voc_demuxer = {
voc_read_header, voc_read_header,
voc_read_packet, voc_read_packet,
voc_read_close, voc_read_close,
.codec_tag={voc_codec_tags}, .codec_tag=(const AVCodecTag*[]){voc_codec_tags, 0},
}; };
...@@ -101,5 +101,5 @@ AVOutputFormat voc_muxer = { ...@@ -101,5 +101,5 @@ AVOutputFormat voc_muxer = {
voc_write_header, voc_write_header,
voc_write_packet, voc_write_packet,
voc_write_trailer, voc_write_trailer,
.codec_tag={voc_codec_tags}, .codec_tag=(const AVCodecTag*[]){voc_codec_tags, 0},
}; };
...@@ -235,7 +235,7 @@ AVInputFormat wav_demuxer = { ...@@ -235,7 +235,7 @@ AVInputFormat wav_demuxer = {
wav_read_packet, wav_read_packet,
wav_read_close, wav_read_close,
wav_read_seek, wav_read_seek,
.codec_tag= {codec_wav_tags}, .codec_tag= (const AVCodecTag*[]){codec_wav_tags, 0},
}; };
#endif #endif
#ifdef CONFIG_WAV_MUXER #ifdef CONFIG_WAV_MUXER
...@@ -250,6 +250,6 @@ AVOutputFormat wav_muxer = { ...@@ -250,6 +250,6 @@ AVOutputFormat wav_muxer = {
wav_write_header, wav_write_header,
wav_write_packet, wav_write_packet,
wav_write_trailer, wav_write_trailer,
.codec_tag= {codec_wav_tags}, .codec_tag= (const AVCodecTag*[]){codec_wav_tags, 0},
}; };
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment