Commit 6a8b3ffb005547ad59afe22af15e0008e3fdf58c
1 parent
fb7063c4
修复当文件只有一个时合成失败的问题
Showing
1 changed file
with
2 additions
and
1 deletions
src/main/java/top/panll/assist/service/VideoFileService.java
| @@ -247,8 +247,9 @@ public class VideoFileService { | @@ -247,8 +247,9 @@ public class VideoFileService { | ||
| 247 | // 文件只有一个则不合并,直接复制过去 | 247 | // 文件只有一个则不合并,直接复制过去 |
| 248 | mergeOrCutTaskInfo.setPercentage("1"); | 248 | mergeOrCutTaskInfo.setPercentage("1"); |
| 249 | // 处理文件路径 | 249 | // 处理文件路径 |
| 250 | - | ||
| 251 | String recordFileResultPath = recordFile.getAbsolutePath() + File.separator + destFileName + ".mp4"; | 250 | String recordFileResultPath = recordFile.getAbsolutePath() + File.separator + destFileName + ".mp4"; |
| 251 | + File destFile = new File(recordFileResultPath); | ||
| 252 | + destFile.deleteOnExit(); | ||
| 252 | try { | 253 | try { |
| 253 | Files.copy(fileList.get(0).toPath(), Paths.get(recordFileResultPath)); | 254 | Files.copy(fileList.get(0).toPath(), Paths.get(recordFileResultPath)); |
| 254 | } catch (IOException e) { | 255 | } catch (IOException e) { |