DelayMode is cast to an i32here, but in the new method signature it's a usize. The enum you can use for this in the original library uses negative values though, so there is no way to set the delay mode to anything other than relative to a video track (specified here), so it wont work for a pure audio application.
An easy fix would be to just change the type of DelayMode to isize instead. Alternatively, you could add a 4th enum variant that holds a usize and then match on them:
enum AudioDelay {
DELAY_NO_SHIFT,
DELAY_TIME_ZERO,
DELAY_FIRST_VIDEO_TRACK,
DELAY_VIDEO_TRACK(usize),
}
let delayMode = match DelayMode {
AudioDelay::DELAY_NO_SHIFT => -3,
AudioDelay::DELAY_TIME_ZERO => -2,
AudioDelay::DELAY_FIRST_VIDEO_TRACK => -1,
AudioDelay::DELAY_VIDEO_TRACK(track) => track as isize,
Though that's not a valid cast so you'd need to use try_from or something, but you get the point.
DelayMode
is cast to ani32
here, but in thenew
method signature it's ausize
. The enum you can use for this in the original library uses negative values though, so there is no way to set the delay mode to anything other than relative to a video track (specified here), so it wont work for a pure audio application.An easy fix would be to just change the type of
DelayMode
toisize
instead. Alternatively, you could add a 4th enum variant that holds ausize
and then match on them:Though that's not a valid cast so you'd need to use
try_from
or something, but you get the point.