diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-02-29 14:58:51 +0000 |
---|---|---|
committer | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-02-29 15:29:43 +0000 |
commit | 14a69ae60c64a071eb65a8521bf3c339322f5903 (patch) | |
tree | 0fa0cc7b8958cecadff8fb6561b8fc4b2613115f /libavformat | |
parent | 8c5092912b19e793412b07e070da2f8636c2c2f3 (diff) | |
parent | dc6527ed908e4d330738f139074455ffbe56a2de (diff) | |
download | ffmpeg-14a69ae60c64a071eb65a8521bf3c339322f5903.tar.gz |
Merge commit 'dc6527ed908e4d330738f139074455ffbe56a2de'
FATE tests have been updated to patch. They do not differ in
any meaningful way.
* commit 'dc6527ed908e4d330738f139074455ffbe56a2de':
nutenc: do not use AVCodecContext.frame_size
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/nutenc.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c index b6582efb4c..d8af5ea001 100644 --- a/libavformat/nutenc.c +++ b/libavformat/nutenc.c @@ -201,9 +201,16 @@ static void build_frame_code(AVFormatContext *s) key_frame = intra_only; #if 1 if (is_audio) { - int frame_bytes = codec->frame_size * (int64_t)codec->bit_rate / - (8 * codec->sample_rate); + int frame_bytes; int pts; + + if (codec->block_align > 0) { + frame_bytes = codec->block_align; + } else { + int frame_size = av_get_audio_frame_duration(codec, 0); + frame_bytes = frame_size * (int64_t)codec->bit_rate / (8 * codec->sample_rate); + } + for (pts = 0; pts < 2; pts++) { for (pred = 0; pred < 2; pred++) { FrameCode *ft = &nut->frame_code[start2]; |