Fix off-by-one error, which lead to only BufferMax-1 segments getting transcoded per batch#61
Conversation
…ng transcoded per batch
|
I think when we already address this issue, it would be good to create unit tests that highlight the issue that is being fixed. |
Of course, I don't know why I didn't think of this. I'm gonna look into it! |
dd0285e to
041bc50
Compare
|
Added a unit test. It did require little bit of dependency injection, to be able to stub out the FFmpeg calls in the test. On On the fix branch: |
|
Hmm, I'm not so sure anymore. I've just had o3 call this a sentinel entry, and argue that by design, only Is that correct? Is the whole "encode only |
|
Huh. I am also confused. Simply, all the segments that are advertised to be available should be available. It now doesn't really matter if we do open or closed set. |
What do you mean by "segments that are advertised"? This is about the 'prefetching' (or rather: speculative transcoding) of not-yet-requested segments via the |
Potential fix for #60
The simplest possible fix is to just remove the
-1in the for loop, changing the currentto the new
I guess another possible fix would be to keep the
-1, but change the operator to<=:This PR suggests a slightly more involved approach, by also renaming all the local variables, so the algorithm is easier to read and reason about.