mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-08-03 00:37:21 -04:00
Extract the "use whatever decoder ffmpeg provides" logic from FFmpeg_Input into a shared open_fallback_decoder() and call it from FfmpegCamera, which had lost the fallback: its generic path only ran inside the preferred-codec loop, so an empty get_decoder_data() result failed outright instead of trying the codec's default decoder. The dec_codecs table stays a preference list; a codec present in the ffmpeg build but absent from the table (e.g. libopenh264 for H264) now decodes via the fallback instead of requiring a hard-coded entry. Add tests/zm_ffmpeg_fallback.cpp covering the fallback with a codec not in dec_codecs (mpeg2video), the optional codec_out argument, and the no-decoder case. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>