avformat/mpegenc: Forward error code

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
Andreas Rheinhardt 2021-02-15 13:55:07 +01:00
parent 4294f64d57
commit d150c2038d
1 changed files with 4 additions and 3 deletions

View File

@ -1151,7 +1151,7 @@ static int mpeg_mux_write_packet(AVFormatContext *ctx, AVPacket *pkt)
StreamInfo *stream = st->priv_data; StreamInfo *stream = st->priv_data;
int64_t pts, dts; int64_t pts, dts;
PacketDesc *pkt_desc; PacketDesc *pkt_desc;
int preload; int preload, ret;
const int is_iframe = st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && const int is_iframe = st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO &&
(pkt->flags & AV_PKT_FLAG_KEY); (pkt->flags & AV_PKT_FLAG_KEY);
@ -1207,8 +1207,9 @@ static int mpeg_mux_write_packet(AVFormatContext *ctx, AVPacket *pkt)
pkt_desc->unwritten_size = pkt_desc->unwritten_size =
pkt_desc->size = size; pkt_desc->size = size;
if (av_fifo_realloc2(stream->fifo, av_fifo_size(stream->fifo) + size) < 0) ret = av_fifo_realloc2(stream->fifo, av_fifo_size(stream->fifo) + size);
return -1; if (ret < 0)
return ret;
if (s->is_dvd) { if (s->is_dvd) {
// min VOBU length 0.4 seconds (mpucoder) // min VOBU length 0.4 seconds (mpucoder)