Browse Source

matroskaenc: restore compatibility with non referenced AVPacket

Signed-off-by: Anton Khirnov <anton@khirnov.net>
tags/n2.0
Rafaël Carré Anton Khirnov 12 years ago
parent
commit
c3e58f8fb7
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      libavformat/matroskaenc.c

+ 5
- 2
libavformat/matroskaenc.c View File

@@ -1298,8 +1298,11 @@ static int mkv_write_packet(AVFormatContext *s, AVPacket *pkt)
// keyframe's timecode is contained in the same cluster for WebM
if (codec->codec_type == AVMEDIA_TYPE_AUDIO) {
mkv->cur_audio_pkt = *pkt;
mkv->cur_audio_pkt.buf = av_buffer_ref(pkt->buf);
ret = mkv->cur_audio_pkt.buf ? 0 : AVERROR(ENOMEM);
if (pkt->buf) {
mkv->cur_audio_pkt.buf = av_buffer_ref(pkt->buf);
ret = mkv->cur_audio_pkt.buf ? 0 : AVERROR(ENOMEM);
} else
ret = av_dup_packet(&mkv->cur_audio_pkt);
} else
ret = mkv_write_packet_internal(s, pkt);
return ret;


Loading…
Cancel
Save