uint32_t order_mask = 0;
int i_channels_src = 0;
msg_Dbg( p_enc, "Creating channel order for reordering");
-# if LIBAVCODEC_VERSION_CHECK(59, 24, 100)
+# if LIBAVCODEC_VERSION_CHECK(59, 24, 100) && LIBAVUTIL_VERSION_CHECK(57, 24, 100)
av_channel_layout_default( &p_context->ch_layout, p_enc->fmt_out.audio.i_channels );
uint64_t channel_mask = p_context->ch_layout.u.mask;
# else
if( p_enc->fmt_out.audio.i_channels > 2 )
{
-#if LIBAVCODEC_VERSION_CHECK(59, 24, 100)
+#if LIBAVCODEC_VERSION_CHECK(59, 24, 100) && LIBAVUTIL_VERSION_CHECK(57, 24, 100)
av_channel_layout_default( &p_context->ch_layout, 2 );
#else
p_context->channels = 2;
av_frame_unref( p_sys->frame );
p_sys->frame->format = p_sys->p_context->sample_fmt;
p_sys->frame->nb_samples = leftover_samples + p_sys->i_samples_delay;
-#if LIBAVCODEC_VERSION_CHECK(59, 24, 100)
+#if LIBAVCODEC_VERSION_CHECK(59, 24, 100) && LIBAVUTIL_VERSION_CHECK(57, 24, 100)
av_channel_layout_copy(&p_sys->frame->ch_layout, &p_sys->p_context->ch_layout);
#else
p_sys->frame->channel_layout = p_sys->p_context->channel_layout;
p_sys->frame->pts = date_Get( &p_sys->buffer_date ) * p_sys->p_context->time_base.den /
CLOCK_FREQ / p_sys->p_context->time_base.num;
-#if LIBAVCODEC_VERSION_CHECK(59, 24, 100)
+#if LIBAVCODEC_VERSION_CHECK(59, 24, 100) && LIBAVUTIL_VERSION_CHECK(57, 24, 100)
av_channel_layout_copy(&p_sys->frame->ch_layout, &p_sys->p_context->ch_layout);
#else
p_sys->frame->channel_layout = p_sys->p_context->channel_layout;
{
case AUDIO_ES:
codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
-#if LIBAVCODEC_VERSION_CHECK(59, 24, 100)
+#if LIBAVUTIL_VERSION_CHECK(57, 24, 100)
av_channel_layout_default( &codecpar->ch_layout, fmt->audio.i_channels );
#else
codecpar->channels = fmt->audio.i_channels;