File tree Expand file tree Collapse file tree 1 file changed +27
-6
lines changed Expand file tree Collapse file tree 1 file changed +27
-6
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,13 @@ handle_error() {
33
33
log " ERROR" " An error occurred"
34
34
newline
35
35
errcode=1
36
- endprocess
36
+ kill_child
37
+ }
38
+
39
+ kill_child () {
40
+ if [[ " $child " != " " ]]; then
41
+ kill " $child "
42
+ fi
37
43
}
38
44
39
45
endprocess () {
@@ -44,12 +50,9 @@ endprocess() {
44
50
cp " $stderrfile " " $stderrfile .prev"
45
51
fi
46
52
53
+ kill_child
47
54
rm -f " $stderrfile "
48
55
49
- if [[ " $child " != " " ]]; then
50
- kill " $child "
51
- fi
52
-
53
56
exit $errcode
54
57
}
55
58
@@ -114,8 +117,26 @@ info "========================================[start ffmpeg $pid]"
114
117
info " DEFAULT ARGS: $* "
115
118
info " UPDATED ARGS: ${args[*]} "
116
119
117
- " /var/packages/${ffmpeg_version} /target/bin/ffmpeg" " ${args[@]} " < & 0 2>> $stderrfile &
120
+ info " Trying with VideoStation's ffmpeg with fixed args..."
121
+ /var/packages/VideoStation/target/bin/ffmpeg.orig " ${args[@]} " < & 0 2>> $stderrfile &
122
+ child=$!
123
+ wait " $child "
124
+
125
+ if [[ $errcode -eq 0 ]]; then
126
+ endprocess
127
+ fi
128
+
129
+ info " Trying with VideoStation's ffmpeg with default args..."
130
+ /var/packages/VideoStation/target/bin/ffmpeg.orig " $@ " < & 0 2>> $stderrfile &
131
+ child=$!
132
+ wait " $child "
118
133
134
+ if [[ $errcode -eq 0 ]]; then
135
+ endprocess
136
+ fi
137
+
138
+ info " Trying with SC's ffmpeg and fixed args..."
139
+ " /var/packages/${ffmpeg_version} /target/bin/ffmpeg" " ${args[@]} " < & 0 2>> $stderrfile &
119
140
child=$!
120
141
wait " $child "
121
142
You can’t perform that action at this time.
0 commit comments