Log in

View Full Version : ConditionalReader bug... and a fix?


stickboy
15th June 2004, 10:14
I tried the following AviSynth script:BlankClip(pixel_type="yuy2")
ScriptClip("Subtitle(String(foo))")
ConditionalReader("foo.txt", "foo")foo.txt:Type int
Default 0

I 0 100 0 100In the resulting clip, the subtitles 1, 4, 6, 8, 11, 13, 16, 19, 22, 24, ... never appear. If I use type float, everything's fine. (I expected that maybe the numbers were off slightly from the floating-point calculations, but that doesn't seem to be the case.)

I'm not sure why, but when I refactored the following code in conditional_reader.cpp (line 129 or thereabout):if (mode == MODE_FLOAT) {
SetFrame(i+start, AVSValue(where*diff+set_start.AsFloat()));
} else {
SetFrame(i+start, AVSValue((int)(where*diff+set_start.AsFloat())));
}changing it to:float n = where * diff + set_start.AsFloat();
SetFrame(i+start, (mode == MODE_FLOAT)
? AVSValue(n)
: AVSValue((int) n));the problem seemed to go away.

Wacky VC6 compiler error?

sh0dan
17th June 2004, 17:04
a bit weird... But thanks for the fix - applied!