mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02: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))
|
else if (!(avctx->codec->capabilities & CODEC_CAP_DELAY))
|
||||||
avpkt->pts = avpkt->dts = frame->pts;
|
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++;
|
avctx->frame_number++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user