mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-23 23:21:06 +01:00
Merge commit '1967cd4e4c'
* commit '1967cd4e4c': audiointerleave: check av_new_packet return value Conflicts: libavformat/audiointerleave.c See:3ca8a23288Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
6d2a2bfb59
1 changed files with 4 additions and 3 deletions
|
|
@ -80,13 +80,14 @@ static int interleave_new_audio_packet(AVFormatContext *s, AVPacket *pkt,
|
|||
{
|
||||
AVStream *st = s->streams[stream_index];
|
||||
AudioInterleaveContext *aic = st->priv_data;
|
||||
|
||||
int ret;
|
||||
int size = FFMIN(av_fifo_size(aic->fifo), *aic->samples * aic->sample_size);
|
||||
if (!size || (!flush && size == av_fifo_size(aic->fifo)))
|
||||
return 0;
|
||||
|
||||
if (av_new_packet(pkt, size) < 0)
|
||||
return AVERROR(ENOMEM);
|
||||
ret = av_new_packet(pkt, size);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
av_fifo_generic_read(aic->fifo, pkt->data, size, NULL);
|
||||
|
||||
pkt->dts = pkt->pts = aic->dts;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue