Browse Source

avcodec/utils: unbreak BINKAUDIO_DCT duration calculation

tags/n4.4
Paul B Mahol 4 years ago
parent
commit
89e2fbceee
1 changed files with 4 additions and 8 deletions
  1. +4
    -8
      libavcodec/utils.c

+ 4
- 8
libavcodec/utils.c View File

@@ -1668,14 +1668,10 @@ static int get_audio_frame_duration(enum AVCodecID id, int sr, int ch, int ba,
return 256 * sr / 245;
else if (id == AV_CODEC_ID_DST)
return 588 * sr / 44100;

if (ch > 0) {
/* calc from sample rate and channels */
if (id == AV_CODEC_ID_BINKAUDIO_DCT) {
if (sr / 22050 > 22)
return 0;
return (480 << (sr / 22050)) / ch;
}
else if (id == AV_CODEC_ID_BINKAUDIO_DCT) {
if (sr / 22050 > 22)
return 0;
return (480 << (sr / 22050));
}

if (id == AV_CODEC_ID_MP3)


Loading…
Cancel
Save