You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rtpengine/lib/fix_frame_channel_layout-01.h

19 lines
508 B

#include <libavutil/frame.h>
#include <libavutil/channel_layout.h>
#include "compat.h"
INLINE void fix_frame_channel_layout(AVFrame *frame) {
if (frame->channel_layout) {
#if LIBAVUTIL_VERSION_MAJOR < 56
if (!frame->channels)
frame->channels = av_frame_get_channels(frame);
#endif
return;
}
#if LIBAVUTIL_VERSION_MAJOR < 56
frame->channel_layout = av_get_default_channel_layout(av_frame_get_channels(frame));
#else
frame->channel_layout = av_get_default_channel_layout(frame->channels);
#endif
}