mirror of
https://github.com/IllusionMan1212/ffui.git
synced 2026-10-24 02:12:35 +00:00
fix: don't gracefully exit on a progress=end with a total_size of 0. this is likely a nonzero exit
This commit is contained in:
@@ -42,6 +42,7 @@ func TempSock(totalDuration float64, teaP *tea.Program) string {
|
|||||||
go func() {
|
go func() {
|
||||||
re := regexp.MustCompile(`out_time_ms=(\d+)`)
|
re := regexp.MustCompile(`out_time_ms=(\d+)`)
|
||||||
speedRe := regexp.MustCompile(`speed=(\d+\.\d+x)`)
|
speedRe := regexp.MustCompile(`speed=(\d+\.\d+x)`)
|
||||||
|
totalSizeRe := regexp.MustCompile(`total_size=(\d+)`)
|
||||||
|
|
||||||
fd, err := l.Accept()
|
fd, err := l.Accept()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -65,6 +66,12 @@ func TempSock(totalDuration float64, teaP *tea.Program) string {
|
|||||||
cp = fmt.Sprintf("%.2f", float64(c)/totalDuration/1000000)
|
cp = fmt.Sprintf("%.2f", float64(c)/totalDuration/1000000)
|
||||||
}
|
}
|
||||||
if strings.Contains(data, "progress=end") {
|
if strings.Contains(data, "progress=end") {
|
||||||
|
totalSize := totalSizeRe.FindString(data)
|
||||||
|
if len(totalSize) > 0 && strings.Split(totalSize, "=")[1] == "0" {
|
||||||
|
// Command failed. Don't send a finishedEncodingVideo message.
|
||||||
|
// encode() will take care of reporting the error.
|
||||||
|
continue
|
||||||
|
}
|
||||||
cp = "done"
|
cp = "done"
|
||||||
teaP.Send(finishedEncodingVideo{})
|
teaP.Send(finishedEncodingVideo{})
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user