On Thu, 15 Oct 2015 02:26:44 +0200
Luca Barbato <[email protected]> wrote:

> ---
>  libavformat/matroskaenc.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
> index f1bd272..baffd54 100644
> --- a/libavformat/matroskaenc.c
> +++ b/libavformat/matroskaenc.c
> @@ -1608,12 +1608,7 @@ static int mkv_write_packet(AVFormatContext *s, 
> AVPacket *pkt)
>      // buffer an audio packet to ensure the packet containing the video
>      // keyframe's timecode is contained in the same cluster for WebM
>      if (codec_type == AVMEDIA_TYPE_AUDIO) {
> -        mkv->cur_audio_pkt = *pkt;
> -        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);
> +        ret = av_packet_ref(&mkv->cur_audio_pkt, pkt);
>      } else
>          ret = mkv_write_packet_internal(s, pkt);
>      return ret;

LGTM.
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to