]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/au.c
move resolve_host from tcp.c to os_support.c as it is used widely
[ffmpeg] / libavformat / au.c
index acc42b40226c5aafbbc2fe57716511be50fe348f..aaa97c76faa222acc504bd136792592b33cbdf07 100644 (file)
@@ -32,7 +32,7 @@
 #include "riff.h"
 
 /* if we don't know the size in advance */
-#define AU_UNKOWN_SIZE ((uint32_t)(~0))
+#define AU_UNKNOWN_SIZE ((uint32_t)(~0))
 
 /* The ffmpeg codecs we support, and the IDs they have in the file */
 static const AVCodecTag codec_au_tags[] = {
@@ -46,13 +46,11 @@ static const AVCodecTag codec_au_tags[] = {
 /* AUDIO_FILE header */
 static int put_au_header(ByteIOContext *pb, AVCodecContext *enc)
 {
-    if(!enc->codec_tag)
-       enc->codec_tag = codec_get_tag(codec_au_tags, enc->codec_id);
     if(!enc->codec_tag)
         return -1;
     put_tag(pb, ".snd");       /* magic number */
     put_be32(pb, 24);           /* header size */
-    put_be32(pb, AU_UNKOWN_SIZE); /* data size */
+    put_be32(pb, AU_UNKNOWN_SIZE); /* data size */
     put_be32(pb, (uint32_t)enc->codec_tag);     /* codec ID */
     put_be32(pb, enc->sample_rate);
     put_be32(pb, (uint32_t)enc->channels);
@@ -105,8 +103,6 @@ static int au_write_trailer(AVFormatContext *s)
 static int au_probe(AVProbeData *p)
 {
     /* check file header */
-    if (p->buf_size <= 24)
-        return 0;
     if (p->buf[0] == '.' && p->buf[1] == 's' &&
         p->buf[2] == 'n' && p->buf[3] == 'd')
         return AVPROBE_SCORE_MAX;
@@ -190,6 +186,7 @@ AVInputFormat au_demuxer = {
     au_read_packet,
     au_read_close,
     pcm_read_seek,
+    .codec_tag= (const AVCodecTag*[]){codec_au_tags, 0},
 };
 #endif
 
@@ -205,5 +202,6 @@ AVOutputFormat au_muxer = {
     au_write_header,
     au_write_packet,
     au_write_trailer,
+    .codec_tag= (const AVCodecTag*[]){codec_au_tags, 0},
 };
 #endif //CONFIG_AU_MUXER