zmwangx / rust-ffmpeg

Safe FFmpeg wrapper.
Do What The F*ck You Want To Public License
1.2k stars 195 forks source link

fix graph input/output linked list insertion #156

Open joprice opened 12 months ago

joprice commented 12 months ago

This fixes a bug where adding multiple inputs or outputs to a graph causes at most two of them two be inserted. The result is errors such as

Input pad "default" with type audio of the filter instance "out2" of abuffersink not connected to any source

when calling validate. The fix walks the linked list and appends the new node to the end. This operation is linear, with the assumption that inputs and outputs are small and building the graph happens infrequently.

I added a test which reproduces the issue for both inputs and outputs.