Browse Source

lavf/mp3enc: don't abort if audio packets can't be buffered

Instead skip the picture streams and flush the queued audio packets.
Should address ticket #3851.

Signed-off-by: James Almer <jamrial@gmail.com>
tags/n2.4
James Almer 11 years ago
parent
commit
d3e9bee6f7
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      libavformat/mp3enc.c

+ 6
- 2
libavformat/mp3enc.c View File

@@ -421,8 +421,12 @@ static int mp3_write_packet(AVFormatContext *s, AVPacket *pkt)
/* buffer audio packets until we get all the pictures */
AVPacketList *pktl = av_mallocz(sizeof(*pktl));
int ret;
if (!pktl)
return AVERROR(ENOMEM);
if (!pktl) {
av_log(s, AV_LOG_WARNING, "Not enough memory to buffer audio. Skipping picture streams\n");
mp3->pics_to_write = 0;
mp3_queue_flush(s);
return mp3_write_audio_packet(s, pkt);
}

ret = av_copy_packet(&pktl->pkt, pkt);
if (ret < 0) {


Loading…
Cancel
Save