Also don't print subprocess result to OSD, as it is not comprehensible.
Showing the changes to player/lua/select.lua (1 of 1 file). Show all
Unified · Split
| @@ -193,20 +193,18 @@ mp.add_forced_key_binding(nil, "select-subtitle-line", function () · 192 unmodified lines | |||
| 193 | name = "subprocess", | 193 | name = "subprocess", |
| 194 | capture_stdout = true, | 194 | capture_stdout = true, |
| 195 | args = sub.external | 195 | args = sub.external |
| 196 | and {"ffmpeg", "-loglevel", "quiet", "-i", sub["external-filename"], | 196 | and {"ffmpeg", "-loglevel", "error", "-i", sub["external-filename"], |
| 197 | "-f", "lrc", "-map_metadata", "-1", "-fflags", "+bitexact", "-"} | 197 | "-f", "lrc", "-map_metadata", "-1", "-fflags", "+bitexact", "-"} |
| 198 | or {"ffmpeg", "-loglevel", "quiet", "-i", mp.get_property("path"), | 198 | or {"ffmpeg", "-loglevel", "error", "-i", mp.get_property("path"), |
| 199 | "-map", "s:" .. sub["id"] - 1, "-f", "lrc", "-map_metadata", | 199 | "-map", "s:" .. sub["id"] - 1, "-f", "lrc", "-map_metadata", |
| 200 | "-1", "-fflags", "+bitexact", "-"} | 200 | "-1", "-fflags", "+bitexact", "-"} |
| 201 | }) | 201 | }) |
| 202 | 202 | ||
| 203 | if r.status < 0 then | 203 | if r.error_string == "init" then |
| 204 | show_error("subprocess error: " .. r.error_string) | 204 | show_error("Failed to extract subtitles: ffmpeg not found.") |
| 205 | return | 205 | return |
| 206 | end | 206 | elseif r.status ~= 0 then |
| 207 | 207 | show_error("Failed to extract subtitles.") | |
| 208 | if r.status > 0 then | ||
| 209 | show_error("ffmpeg failed with code " .. r.status) | ||
| 210 | return | 208 | return |
| 211 | end | 209 | end |
| 212 | 210 | ||