]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/blobdiff - libavformat/mp3.c
frsh: Export information about the last RTP contract and VRES
[frescor/ffmpeg.git] / libavformat / mp3.c
index 21e1fd9e5bc5602f3d1fc19b2c1ee9a8ed995d67..e835a3442420061f0ea5c11325b93ccefaf3cdf5 100644 (file)
@@ -198,7 +198,8 @@ static void id3v2_read_ttag(AVFormatContext *s, int taglen, const char *key)
     }
 
     if (!strcmp(key, "genre")
-        && sscanf(dst, "(%d)", &genre) == 1 && genre <= ID3v1_GENRE_MAX)
+        && (sscanf(dst, "(%d)", &genre) == 1 || sscanf(dst, "%d", &genre) == 1)
+        && genre <= ID3v1_GENRE_MAX)
         av_strlcpy(dst, id3v1_genre_str[genre], sizeof(dst));
 
     if (*dst)
@@ -390,9 +391,11 @@ static int mp3_read_probe(AVProbeData *p)
     }
     if   (first_frames>=3) return AVPROBE_SCORE_MAX/2+1;
     else if(max_frames>500)return AVPROBE_SCORE_MAX/2;
-    else if(max_frames>=3) return AVPROBE_SCORE_MAX/4;
+    else if(max_frames>=4) return AVPROBE_SCORE_MAX/4;
+    else if(buf0!=p->buf)  return AVPROBE_SCORE_MAX/4-1;
     else if(max_frames>=1) return 1;
     else                   return 0;
+//mpegps_mp3_unrecognized_format.mpg has max_frames=3
 }
 
 /**
@@ -656,7 +659,7 @@ static int mp3_write_trailer(struct AVFormatContext *s)
 #if CONFIG_MP3_DEMUXER
 AVInputFormat mp3_demuxer = {
     "mp3",
-    NULL_IF_CONFIG_SMALL("MPEG audio"),
+    NULL_IF_CONFIG_SMALL("MPEG audio layer 2/3"),
     0,
     mp3_read_probe,
     mp3_read_header,