mirror of https://git.ffmpeg.org/ffmpeg.git
libopusenc: use ff_alloc_packet2
Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
baf10ad186
commit
1811f1d840
|
@ -331,10 +331,8 @@ static int libopus_encode(AVCodecContext *avctx, AVPacket *avpkt,
|
||||||
/* Maximum packet size taken from opusenc in opus-tools. 60ms packets
|
/* Maximum packet size taken from opusenc in opus-tools. 60ms packets
|
||||||
* consist of 3 frames in one packet. The maximum frame size is 1275
|
* consist of 3 frames in one packet. The maximum frame size is 1275
|
||||||
* bytes along with the largest possible packet header of 7 bytes. */
|
* bytes along with the largest possible packet header of 7 bytes. */
|
||||||
if (ret = ff_alloc_packet(avpkt, (1275 * 3 + 7) * opus->stream_count)) {
|
if ((ret = ff_alloc_packet2(avctx, avpkt, (1275 * 3 + 7) * opus->stream_count)) < 0)
|
||||||
av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
|
||||||
|
|
||||||
if (avctx->sample_fmt == AV_SAMPLE_FMT_FLT)
|
if (avctx->sample_fmt == AV_SAMPLE_FMT_FLT)
|
||||||
ret = opus_multistream_encode_float(opus->enc, (float *)audio,
|
ret = opus_multistream_encode_float(opus->enc, (float *)audio,
|
||||||
|
|
Loading…
Reference in New Issue