Compare commits

..

No commits in common. "main" and "v1.19.1" have entirely different histories.

3 changed files with 9 additions and 17 deletions

23
api.go
View File

@ -21,20 +21,15 @@ type MergeTsDir_Resp struct {
var gMergeIsRunning bool
var gMergeIsRunningLocker sync.Mutex
func beginMerge() bool {
gMergeIsRunningLocker.Lock()
defer gMergeIsRunningLocker.Unlock()
if gMergeIsRunning != false {
return false
}
gMergeIsRunning = true
return true
}
func MergeTsDir(InputTsDir string, OutputMp4Name string) (resp MergeTsDir_Resp) {
if !beginMerge() {
return resp
{
gMergeIsRunningLocker.Lock()
defer gMergeIsRunningLocker.Unlock()
if gMergeIsRunning != false {
return resp
}
gMergeIsRunning = true
}
defer func() {
@ -61,8 +56,6 @@ func MergeTsDir(InputTsDir string, OutputMp4Name string) (resp MergeTsDir_Resp)
sort.Strings(tsFileList) // 按照字典顺序排序
if OutputMp4Name == "" {
OutputMp4Name = filepath.Join(InputTsDir, "all.mp4")
} else if !filepath.IsAbs(OutputMp4Name) {
OutputMp4Name = filepath.Join(InputTsDir, OutputMp4Name)
}
ctx, cancelFn := context.WithCancel(context.Background())
defer cancelFn()

View File

@ -206,7 +206,6 @@ void MainWindow::updateMergeUi(bool runing)
ui->lineEdit_mergeDir->setEnabled(!runing);
ui->toolButton_selectMergeDir->setEnabled(!runing);
ui->pushButton_stopMerge->setEnabled(runing);
ui->pushButton_startMerge->setEnabled(!runing);
ui->lineEdit_mergeFileName->setEnabled(!runing);
ui->pushButton_returnDownload->setEnabled(!runing);
}

View File

@ -18,7 +18,7 @@
<item>
<widget class="QStackedWidget" name="stackedWidget">
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="page">
<layout class="QVBoxLayout" name="verticalLayout_2">