https://github.com/OpenMW/openmw/commit/61cb5b4da638d520c41a9d99b5850384b2e22679

Index: apps/openmw/mwsound/movieaudiofactory.cpp
--- apps/openmw/mwsound/movieaudiofactory.cpp.orig
+++ apps/openmw/mwsound/movieaudiofactory.cpp
@@ -44,7 +44,11 @@ namespace MWSound
 
         size_t getSampleOffset()
         {
+#if FFMPEG_5_OR_GREATER
+            ssize_t clock_delay = (mFrameSize - mFramePos) / mOutputChannelLayout.nb_channels /
+#else
             ssize_t clock_delay = (mFrameSize-mFramePos) / av_get_channel_layout_nb_channels(mOutputChannelLayout) /
+#endif
                                   av_get_bytes_per_sample(mOutputSampleFormat);
             return (size_t)(mAudioClock*mAudioContext->sample_rate) - clock_delay;
         }
