mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-25 08:42:39 +00:00
lavc: shrink encoded video packet size after encoding.
Based on a patch by Nicolas George <nicolas.george <at> normalesup.org>
This commit is contained in:
parent
0ce4fe482c
commit
eb727387fd
@ -1113,6 +1113,12 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx,
|
||||
else if (!(avctx->codec->capabilities & CODEC_CAP_DELAY))
|
||||
avpkt->pts = avpkt->dts = frame->pts;
|
||||
|
||||
if (!user_packet && avpkt->data) {
|
||||
uint8_t *new_data = av_realloc(avpkt->data, avpkt->size);
|
||||
if (new_data)
|
||||
avpkt->data = new_data;
|
||||
}
|
||||
|
||||
avctx->frame_number++;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user