Commit 0a06e6e4 authored by Michael Niedermayer's avatar Michael Niedermayer

av_frame_get_buffer: Do not fail when the channel layout is unknown

Fixes handling of cases with unknown layouts but known channel counts
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 289737c8
......@@ -223,7 +223,7 @@ int av_frame_get_buffer(AVFrame *frame, int align)
if (frame->width > 0 && frame->height > 0)
return get_video_buffer(frame, align);
else if (frame->nb_samples > 0 && frame->channel_layout)
else if (frame->nb_samples > 0 && (frame->channel_layout || frame->channels > 0))
return get_audio_buffer(frame, align);
return AVERROR(EINVAL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment