mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-23 23:21:06 +01:00
nutenc: do not use AVCodecContext.frame_size
It will in general not be available. Use block_align if known or fall back to av_get_audio_frame_duration().
This commit is contained in:
parent
bf7be043fc
commit
dc6527ed90
1 changed files with 9 additions and 2 deletions
|
|
@ -190,9 +190,16 @@ static void build_frame_code(AVFormatContext *s)
|
|||
|
||||
key_frame = intra_only;
|
||||
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];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue