Browse Source

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: Michael Niedermayer <michaelni@gmx.at>
tags/n2.1
Michael Niedermayer 12 years ago
parent
commit
0a06e6e49b
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavutil/frame.c

+ 1
- 1
libavutil/frame.c View File

@@ -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);


Loading…
Cancel
Save