mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-24 16:22:37 +00:00
avcodec/libmp3lame: Remove redundant av_packet_unref()
The AVPacket given to an encoder's encode callback is unreferenced generically on error. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
590d169bdb
commit
af26a8ffbb
@ -280,17 +280,14 @@ static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
|||||||
// Check if subtraction resulted in an overflow
|
// Check if subtraction resulted in an overflow
|
||||||
if ((discard_padding < avctx->frame_size) != (avpkt->duration > 0)) {
|
if ((discard_padding < avctx->frame_size) != (avpkt->duration > 0)) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "discard padding overflow\n");
|
av_log(avctx, AV_LOG_ERROR, "discard padding overflow\n");
|
||||||
av_packet_unref(avpkt);
|
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
if ((!s->delay_sent && avctx->initial_padding > 0) || discard_padding > 0) {
|
if ((!s->delay_sent && avctx->initial_padding > 0) || discard_padding > 0) {
|
||||||
uint8_t* side_data = av_packet_new_side_data(avpkt,
|
uint8_t* side_data = av_packet_new_side_data(avpkt,
|
||||||
AV_PKT_DATA_SKIP_SAMPLES,
|
AV_PKT_DATA_SKIP_SAMPLES,
|
||||||
10);
|
10);
|
||||||
if(!side_data) {
|
if (!side_data)
|
||||||
av_packet_unref(avpkt);
|
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
}
|
|
||||||
if (!s->delay_sent) {
|
if (!s->delay_sent) {
|
||||||
AV_WL32(side_data, avctx->initial_padding);
|
AV_WL32(side_data, avctx->initial_padding);
|
||||||
s->delay_sent = 1;
|
s->delay_sent = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user