[BUG] Flow plugin Reorder streams always reorder even if not needed
Marnalas opened this issue · 2 comments
Marnalas commented
Hi there,
First of all, thank you for the excellent work !
I've noticed a bug with the flow plugin Reorder streams. It always reorder even if the existing order is correct. After some digging in the code, I saw this :
- Line 114 : the current state of the streams is stored
const originalStreams = JSON.stringify(streams);
- Line 116 to 119 : all the streams are added a new property with their index
streams.forEach((stream, index) => { // eslint-disable-next-line no-param-reassign stream.typeIndex = index; });
- Line 219 : after the new order of the streams have determined, the new state of the streams is compared to the original one. If any of the streams' properties has changed, then the ffmpeg command is set to operate the reorder.
if (JSON.stringify(streams) !== originalStreams)
The problem is the step 2 always changes the streams (by adding a new property) so the comparison at step 3 always detects a change in the streams. I'll create a pull request with a solution to this problem.
HaveAGitGat commented
Hi thanks :) added comment on your PR.
HaveAGitGat commented
Was fixed in PR.