mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
avcodec/mlpenc: fix encoding after receiving last frame
This happened when major header needed to be written after input EOF.
This commit is contained in:
parent
e663030267
commit
f67403edb3
@ -2122,10 +2122,11 @@ static int mlp_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
|
||||
input_and_return:
|
||||
|
||||
if (frame)
|
||||
if (frame) {
|
||||
ctx->shorten_by = avctx->frame_size - frame->nb_samples;
|
||||
ctx->next_major_frame_size += avctx->frame_size;
|
||||
ctx->next_major_number_of_frames++;
|
||||
ctx->next_major_frame_size += avctx->frame_size;
|
||||
ctx->next_major_number_of_frames++;
|
||||
}
|
||||
if (data)
|
||||
input_data(ctx, data, frame->nb_samples);
|
||||
|
||||
@ -2166,7 +2167,7 @@ input_and_return:
|
||||
}
|
||||
}
|
||||
|
||||
if (!frame)
|
||||
if (!frame && ctx->last_frames < ctx->max_restart_interval - 1)
|
||||
avctx->frame_number++;
|
||||
|
||||
if (bytes_written > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user