109{
111 return false;
112
113 AVChannelLayout out_layout;
114 av_channel_layout_copy(&out_layout, &
codec_context->ch_layout);
115
116 uint32_t out_rate = target_rate > 0 ? target_rate :
sample_rate;
117 AVSampleFormat out_fmt = planar_output ? AV_SAMPLE_FMT_DBLP : AV_SAMPLE_FMT_DBL;
118
119 int ret = swr_alloc_set_opts2(
121 &out_layout, out_fmt, static_cast<int>(out_rate),
123 0, nullptr);
124
125 av_channel_layout_uninit(&out_layout);
126
129 return false;
130 }
131
136 return false;
137 }
138
139 return true;
140}
SwrContext * swr_context
Owned; freed in destructor.
AVCodecContext * codec_context
Owned; freed in destructor.