diff options
author | James Almer <jamrial@gmail.com> | 2014-08-26 21:31:14 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2014-08-27 13:51:34 -0300 |
commit | d3e9bee6f7e527dcb15ca87a426a09ad9f5a8a60 (patch) | |
tree | 0285b252777b14b3b8ba54730fd03619dcdbe67e /libavformat/mp3enc.c | |
parent | 12df9b9a151026c4b382df8852fad38165b49f95 (diff) | |
download | ffmpeg-d3e9bee6f7e527dcb15ca87a426a09ad9f5a8a60.tar.gz |
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>
Diffstat (limited to 'libavformat/mp3enc.c')
-rw-r--r-- | libavformat/mp3enc.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c index c0270c21db..7e6b2e1795 100644 --- a/libavformat/mp3enc.c +++ b/libavformat/mp3enc.c @@ -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) { |