Browse Source

Move frame_size fallback from ff_get_audio_frame_size() to av_get_audio_frame_duration()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.4
Michael Niedermayer 10 years ago
parent
commit
ed488d1535
2 changed files with 4 additions and 4 deletions
  1. +4
    -0
      libavcodec/utils.c
  2. +0
    -4
      libavformat/utils.c

+ 4
- 0
libavcodec/utils.c View File

@@ -3306,6 +3306,10 @@ int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes)
}
}

/* Fall back on using frame_size */
if (avctx->frame_size > 1 && frame_bytes)
return avctx->frame_size;

return 0;
}



+ 0
- 4
libavformat/utils.c View File

@@ -722,10 +722,6 @@ int ff_get_audio_frame_size(AVCodecContext *enc, int size, int mux)
if ((frame_size = av_get_audio_frame_duration(enc, size)) > 0)
return frame_size;

/* Fall back on using frame_size if muxing. */
if (enc->frame_size > 1)
return enc->frame_size;

//For WMA we currently have no other means to calculate duration thus we
//do it here by assuming CBR, which is true for all known cases.
if (!mux && enc->bit_rate>0 && size>0 && enc->sample_rate>0 && enc->block_align>1) {


Loading…
Cancel
Save