@@ -9,32 +9,24 @@ function AppendSegment(
99\ bool hd,
1010\ string pix_type
1111\){
12- filename = base + string(first_val, format) + ".avi"
13- result = AviSource(filename, pixel_type=pix_type)
14-
15- if (hd) {
16- result = result.Eval(resizer + """Resize(sample.width, sample.height)""")
17- } else {
18- scaler = float(sample.height) / float(result.height)
19- temp_width = float(result.width) * scaler
20- result = result.PointResize(int(temp_width), sample.height)
21- result = result.Lanczos4Resize(sample.width, sample.height)
22- }
23-
24- for (i = first_val + 1, last_val) {
12+ for (i = first_val, last_val) {
2513 filename = base + string(i, format) + ".avi"
26- next_clip = AviSource(filename, pixel_type=pix_type)
14+ AviSource(filename, pixel_type=pix_type)
2715
2816 if (hd) {
29- next_clip = next_clip. Eval(resizer + """Resize(sample.width, sample.height)""")
17+ Eval(resizer + """Resize(sample.width, sample.height)""")
3018 } else {
31- scaler = float(sample.height) / float(next_clip .height)
32- temp_width = float(next_clip .width) * scaler
33- next_clip = next_clip. PointResize(int(temp_width), sample.height)
34- next_clip = next_clip. Lanczos4Resize(sample.width, sample.height)
19+ scaler = float(sample.height) / float(last .height)
20+ temp_width = float(last .width) * scaler
21+ PointResize(int(temp_width), sample.height)
22+ Lanczos4Resize(sample.width, sample.height)
3523 }
3624
37- result = result + next_clip
25+ if (i == first_val) {
26+ result = last
27+ } else {
28+ result = result + last
29+ }
3830 }
3931
4032 return result
0 commit comments