ec-cc streams: skip the empty block that ffmpeg's trailing SRT newline leaves, which panicked the reference parser
Browse files at this commitc56a74b7d068678a37c13cb815b250855d77ed6fParent: 5c243571 changed file +1 -1
crates/ec-cc/tests/streams.rsmodified+1 -1
| @@ -143,7 +143,7 @@ fn ffmpeg_cues(path: &PathBuf, demuxer_args: &[&str]) -> Vec<(String, f64)> { | |||
| 143 | assert!(st.success()); | 143 | assert!(st.success()); |
| 144 | let text = std::fs::read_to_string(&srt).unwrap(); | 144 | let text = std::fs::read_to_string(&srt).unwrap(); |
| 145 | let mut out = Vec::new(); | 145 | let mut out = Vec::new(); |
| 146 | - for block in text.split("\n\n") { | 146 | + for block in text.split("\n\n").filter(|b| !b.trim().is_empty()) { |
| 147 | let mut l = block.lines(); | 147 | let mut l = block.lines(); |
| 148 | l.next().unwrap(); | 148 | l.next().unwrap(); |
| 149 | let Some(tl) = l.next() else { continue }; | 149 | let Some(tl) = l.next() else { continue }; |