OSDN Git Service

lavc: handle MP3 in get_audio_frame_duration()
authorAnton Khirnov <anton@khirnov.net>
Fri, 2 Dec 2016 12:21:02 +0000 (13:21 +0100)
committerAnton Khirnov <anton@khirnov.net>
Wed, 14 Dec 2016 08:06:44 +0000 (09:06 +0100)
libavcodec/utils.c

index 0b44bb6..5350eb8 100644 (file)
@@ -1186,6 +1186,9 @@ static int get_audio_frame_duration(enum AVCodecID id, int sr, int ch, int ba,
             if (id == AV_CODEC_ID_BINKAUDIO_DCT)
                 return (480 << (sr / 22050)) / ch;
         }
+
+        if (id == AV_CODEC_ID_MP3)
+            return sr <= 24000 ? 576 : 1152;
     }
 
     if (ba > 0) {