Skip to content

Commit 14f3b9d

Browse files
committed
Add FFmpeg load failure print logs to stderr
1 parent 5a9a353 commit 14f3b9d

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/audio.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,8 +1442,11 @@ pub fn load_audio_source(file_path: &str) -> Result<Box<dyn AudioSource>> {
14421442
// 1. Prioritize FFmpeg for video containers (MKV, MP4) to ensure video streams are processed.
14431443
// Symphonia might successfully parse the audio in these containers but would ignore the video.
14441444
if ext == "mkv" || ext == "mp4" {
1445-
if let Ok(source) = try_ffmpeg(file_path, false) {
1446-
return Ok(source);
1445+
match try_ffmpeg(file_path, false) {
1446+
Ok(source) => return Ok(source),
1447+
Err(err) => {
1448+
eprintln!("FFmpeg load failed for {}: {:?}", file_path, err);
1449+
}
14471450
}
14481451
// Fallback to Symphonia if FFmpeg fails
14491452
if let Ok(file) = File::open(file_path) {
@@ -1531,6 +1534,8 @@ pub fn load_audio_source(file_path: &str) -> Result<Box<dyn AudioSource>> {
15311534
let ffmpeg_result = try_ffmpeg(file_path, false);
15321535
if let Ok(source) = ffmpeg_result {
15331536
return Ok(source);
1537+
} else if let Err(ref err) = ffmpeg_result {
1538+
eprintln!("FFmpeg fallback load failed for {}: {:?}", file_path, err);
15341539
}
15351540

15361541
// If all failed, return the ffmpeg error since it's the most descriptive for standard media

0 commit comments

Comments
 (0)