--- a/cinelerra/fileac3.C	2026-09-23 11:08:09.688883257 -0600
+++ b/cinelerra/fileac3.C	2026-09-24 13:57:31.933253051 -0600
@@ -154,7 +154,10 @@
 			codec_context->ch_layout.nb_channels = channels;
 			codec_context->ch_layout.u.mask = layout;
 			av_channel_layout_copy(&codec_context->ch_layout, &ch_layout);
-			codec_context->sample_fmt = codec->sample_fmts[0];
+/*			codec_context->sample_fmt = codec->sample_fmts[0]; */
+			const enum AVSampleFormat *codec_sample_fmts = NULL;
+			avcodec_get_supported_config(NULL, codec, AV_CODEC_CONFIG_SAMPLE_FORMAT, 0, (const void**)&codec_sample_fmts, NULL);
+			codec_context->sample_fmt = codec_sample_fmts[0];
 			SwrContext *tmp_resample_context = NULL;
 			int ret = swr_alloc_set_opts2(&tmp_resample_context,
 					&ch_layout, codec_context->sample_fmt, sample_rate,
