flvmux: Correct breaks in gst_flv_mux_find_best_pad
authorJan Alexander Steffens (heftig) <jan.steffens@ltnglobal.com>
Mon, 31 Aug 2020 11:43:42 +0000 (13:43 +0200)
committerJan Alexander Steffens (heftig) <jan.steffens@ltnglobal.com>
Mon, 31 Aug 2020 13:14:56 +0000 (15:14 +0200)
commit01594d19b8dfac38226910d1b10231c26133c7f9
treeb5653d5fbd5f92274e5a82d68a067a97bdcff4e0
parente69599150844b8136c87dd5a130278d6a1f8e02c
flvmux: Correct breaks in gst_flv_mux_find_best_pad

The code seems to use `continue` and `break` as if both refer to the
surrounding `while` loop. But because `break` breaks out of the
`switch`, they actually have the same effect.

This may have caused the loop not to terminate when it should. E.g. when
`skip_backwards_streams` drops a buffer we should abort the aggregation
and wait for all pads to be filled again. Instead, we might have just
selected a subsequent pad as our new "best".

Replace `break` with `done = TRUE; break`, and `continue` with `break`.
Then simplify the code a bit.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/710>
gst/flv/gstflvmux.c