]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/libnut.c
move audio header parsing in its own function
[ffmpeg] / libavformat / libnut.c
index 6f0142113ed40ae0a30ffd6265aac510b169534a..6ede6ac283c75b119bae3a8cd1832e9554af1f93 100644 (file)
@@ -83,8 +83,8 @@ static int nut_write_header(AVFormatContext * avf) {
         else fourcc = codec_get_tag(nut_tags, codec->codec_id);
 
         if (!fourcc) {
-            if (codec->codec_type == CODEC_TYPE_VIDEO) fourcc = codec_get_bmp_tag(codec->codec_id);
-            if (codec->codec_type == CODEC_TYPE_AUDIO) fourcc = codec_get_wav_tag(codec->codec_id);
+            if (codec->codec_type == CODEC_TYPE_VIDEO) fourcc = codec_get_tag(codec_bmp_tags, codec->codec_id);
+            if (codec->codec_type == CODEC_TYPE_AUDIO) fourcc = codec_get_tag(codec_wav_tags, codec->codec_id);
         }
 
         s[i].fourcc_len = 4;
@@ -166,7 +166,7 @@ AVOutputFormat libnut_muxer = {
 #endif //CONFIG_MUXERS
 
 static int nut_probe(AVProbeData *p) {
-    if (p->buf_size >= ID_LENGTH && !memcmp(p->buf, ID_STRING, ID_LENGTH)) return AVPROBE_SCORE_MAX;
+    if (!memcmp(p->buf, ID_STRING, ID_LENGTH)) return AVPROBE_SCORE_MAX;
 
     return 0;
 }
@@ -235,14 +235,14 @@ static int nut_read_header(AVFormatContext * avf, AVFormatParameters * ap) {
         switch(s[i].type) {
         case NUT_AUDIO_CLASS:
             st->codec->codec_type = CODEC_TYPE_AUDIO;
-            if (st->codec->codec_id == CODEC_ID_NONE) st->codec->codec_id = codec_get_wav_id(st->codec->codec_tag);
+            if (st->codec->codec_id == CODEC_ID_NONE) st->codec->codec_id = codec_get_id(codec_wav_tags, st->codec->codec_tag);
 
             st->codec->channels = s[i].channel_count;
             st->codec->sample_rate = s[i].samplerate_num / s[i].samplerate_denom;
             break;
         case NUT_VIDEO_CLASS:
             st->codec->codec_type = CODEC_TYPE_VIDEO;
-            if (st->codec->codec_id == CODEC_ID_NONE) st->codec->codec_id = codec_get_bmp_id(st->codec->codec_tag);
+            if (st->codec->codec_id == CODEC_ID_NONE) st->codec->codec_id = codec_get_id(codec_bmp_tags, st->codec->codec_tag);
 
             st->codec->width = s[i].width;
             st->codec->height = s[i].height;
@@ -298,7 +298,7 @@ static int nut_read_close(AVFormatContext *s) {
 }
 
 AVInputFormat libnut_demuxer = {
-    "nut",
+    "libnut",
     "nut format",
     sizeof(NUTContext),
     nut_probe,