After spending a bunch of time trying to figure out why attempting to call SetRate with any number of different values in an attempt to speed up, or slow down playback didnt work (AS I THINK MOST PEOPLE WOULD EXPECT), I went and took a look at the C++ to find out what I was doing wrong.
[BinkMediaPlayer.cpp - line 197]
The gist of the C++ is 3 cascading if…else if… else if statements
and the if clause for each contains a hardcoded test for the rate value you specified.
(plus some other condition)
2 of the clauses have the same rate, so if I understand things correctly, we can say the following:
- If the rate you attempt to set is 0, then your video will be paused
- if you attempt to set a rate of 1, then it jumps to the first frame (goto)
- if you attempt to set a rate of ANYTHING ELSE it DOES NOTHING
There is no actual RATE being set anywhere, which is why if you subsequently call GetRate, you will most likely get a value of 1.0 returned (or maybe 0 if you are not actually playing anything)
Now come on… does this really sound like a SetRate function to you?
That’s at best just another PLAY and PAUSE, and yes, semantically you could argue that those are ‘rates’, but if you did argue that, someone needs to take you aside and explain to you why you don’t get invited to parties any more.
Anyone wanna jump in and let me know what is going on with this?
- Is there some secret technique I am just not getting?
- Why would someone write a function accepting a FLOAT as a parameter to have the body of that function ONLY work with values of 0 or 1? (Where I come from that’s a bool, you know?)
- Why would someone leave commented out code in there, but not add a comment to explain why?
- Am I in fact being splendidly dumb and totally failing to understand how that code functions?
- Is there another technique for speeding up, or slowing down bink media playback?
(Even though it appears to be updating on Tick(), I somehow doubt messing with the Tick frequency would have the desired effect) - Is it actually not realistically possible to control the playback rate of Bink media - and that dangling a function called SetRate under my nose was in fact just a cruel and nasty joke to waste my (and several other judging by some forum posts) time - and that the function should really just be removed, or at the very least renamed to something like SetPausedOrPlayingBecauseRateIsNotActuallyAffected()