| 204 | } |
| 205 | |
| 206 | int av_frame_get_buffer(AVFrame *frame, int align) |
| 207 | { |
| 208 | if (frame->format < 0) |
| 209 | return AVERROR(EINVAL); |
| 210 | |
| 211 | if (frame->width > 0 && frame->height > 0) |
| 212 | return get_video_buffer(frame, align); |
| 213 | else if (frame->nb_samples > 0 && |
| 214 | (av_channel_layout_check(&frame->ch_layout))) |
| 215 | return get_audio_buffer(frame, align); |
| 216 | |
| 217 | return AVERROR(EINVAL); |
| 218 | } |
| 219 | |
| 220 | static int frame_copy_props(AVFrame *dst, const AVFrame *src, int force_copy) |
| 221 | { |