Dont transcode CUE tracks to MP3, just copy in original format - *much*

faster
This commit is contained in:
Craig Drummond committed 2022-03-13 11:32:35 +00:00
1 parent 649ce31907
commit 4c40a0b41b
3 files changed
+7 -5

No files matched your search

+4 -2
View File
@@ -192,8 +192,9 @@ pub fn analyze_cue_streaming(tracks: Vec<cue::CueTrack>,) -> BlissResult<Receive
log::debug!("Extracting '{}'", track_path);
if cue_track.duration<last_track_duration {
match Exec::cmd("ffmpeg").arg("-i").arg(&audio_path).arg("-b:a").arg("128k")
match Exec::cmd("ffmpeg").arg("-i").arg(&audio_path)
.arg("-ss").arg(&cue_track.start.hhmmss()).arg("-t").arg(&cue_track.duration.hhmmss())
.arg("-c").arg("copy")
.arg(String::from(tmp_file.to_string_lossy()))
.stderr(NullFile)
.join() {
@@ -201,8 +202,9 @@ pub fn analyze_cue_streaming(tracks: Vec<cue::CueTrack>,) -> BlissResult<Receive
Err(e) => { log::error!("Failed to call ffmpeg. {}", e); }
}
} else {
match Exec::cmd("ffmpeg").arg("-i").arg(&audio_path).arg("-b:a").arg("128k")
match Exec::cmd("ffmpeg").arg("-i").arg(&audio_path)
.arg("-ss").arg(&cue_track.start.hhmmss())
.arg("-c").arg("copy")
.arg(String::from(tmp_file.to_string_lossy()))
.stderr(NullFile)
.join() {
+1 -1
View File
@@ -49,7 +49,7 @@ pub fn parse(audio_path:&PathBuf, cue_path:&PathBuf) -> Vec<CueTrack> {
Some((_, start)) => {
let mut track_path = audio_path.clone();
let ext = audio_path.extension().unwrap().to_string_lossy();
track_path.set_extension(format!("{}{}{}.mp3", ext, MARKER, resp.len()+1));
track_path.set_extension(format!("{}{}{}", ext, MARKER, resp.len()+1));
let mut ctrack = CueTrack {
audio_path: audio_path.clone(),
track_path: track_path,