File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -228,8 +228,27 @@ Future<FFmpegBuildResult> _buildLinux(
228228 'linux/flutter/ephemeral/.plugin_symlinks/fvp/linux/mdk-sdk/lib/amd64/' ,
229229 ),
230230 );
231- // Use -l:libffmpeg.so.8 to link against the exact versioned file.
232- libraries.add (':libffmpeg.so.8' );
231+
232+ // Detect the available FFmpeg shared library in the fvp mdk-sdk directory.
233+ // CI environments may ship a different version than libffmpeg.so.8, so we
234+ // scan for libffmpeg.so.* and fall back to the generic -lffmpeg if needed.
235+ final ffmpegLibDir = input.packageRoot.resolve (
236+ 'linux/flutter/ephemeral/.plugin_symlinks/fvp/linux/mdk-sdk/lib/amd64/' ,
237+ );
238+ final dir = Directory .fromUri (ffmpegLibDir);
239+ String ? detectedLib;
240+ if (dir.existsSync ()) {
241+ final matches = dir
242+ .listSync ()
243+ .whereType <File >()
244+ .where ((f) => p.basename (f.path).startsWith ('libffmpeg.so.' ))
245+ .toList ();
246+ if (matches.isNotEmpty) {
247+ matches.sort ((a, b) => p.basename (b.path).compareTo (p.basename (a.path)));
248+ detectedLib = ':${p .basename (matches .first .path )}' ;
249+ }
250+ }
251+ libraries.add (detectedLib ?? 'ffmpeg' );
233252
234253 return FFmpegBuildResult (
235254 includes: includes,
You can’t perform that action at this time.
0 commit comments