avutil/frame: fix av_frame_copy for unknown layouts
authorMarton Balint <cus@passwd.hu>
Mon, 30 Jan 2017 00:33:18 +0000 (01:33 +0100)
committerMarton Balint <cus@passwd.hu>
Mon, 30 Jan 2017 23:29:49 +0000 (00:29 +0100)
I wonder how unknown layouts ever worked without this?

Reviewed-by: Nicolas George <george@nsup.org>
Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
libavutil/frame.c

index c2f5509..a08e0c5 100644 (file)
@@ -725,7 +725,7 @@ int av_frame_copy(AVFrame *dst, const AVFrame *src)
 
     if (dst->width > 0 && dst->height > 0)
         return frame_copy_video(dst, src);
-    else if (dst->nb_samples > 0 && dst->channel_layout)
+    else if (dst->nb_samples > 0 && dst->channels > 0)
         return frame_copy_audio(dst, src);
 
     return AVERROR(EINVAL);