GNOME Bugzilla – Bug 746518
input-selector: eos is always forwarded, even from unselected pads
Last modified: 2015-03-24 12:32:55 UTC
The attached unit tests shows that input-selector is always forwarding EOS, regardless of the pad that received it
Created attachment 299933 [details] [review] tests: input-selector: verify that eos from unselected pads block Adds a test that creates 2 inputs for input-selector, one of which is an empty stream (just pushes an EOS event) while the other has 1 buffer before EOS. The selected stream is the one that has the buffer. input-selector should block the EOS on the unselected pad and forward the buffer on the other one before forwarding the EOS (once all pads are EOS)
Created attachment 300126 [details] [review] patch Try this, please. Should apply straight to master.
With the waiting working properly, the new test times out since pushing the EOS on the empty_stream_pad now blocks.
I have an improved version here that deals with the blocking, still need to add more test cases, should be ready hopefully later today or tomorrow.
Created attachment 300157 [details] [review] tests: selector: remove weird semicolons at the end of test functions Even though it works, it is not needed and seems more natural to not have semicolons at the end of function declarations
Created attachment 300158 [details] [review] tests: input-selector: new tests for EOS handling 3 new tests: 1) Tests that a stream that is empty (just an EOS event) on inactive pad doesn't get through and tamper with the active pad that still has data 2) Tests that a stream that is shorter than the active one (pushes EOS earlier) doesn't has its EOS pushed 3) Tests that switching to an inactive stream that has received EOS will make input-selector push EOS
The selector tests pass here even with the unfixed master @ 7b0b93d. Isn't that wrong?
Running suite(s): selector 77%: Checks: 9, Failures: 2, Errors: 0 elements/selector.c:525:F:general:test_input_selector_empty_stream:0: Assertion 'gst_pad_push_event (pad, gst_event_new_eos ())' failed elements/selector.c:486:F:general:test_input_selector_switch_to_eos_stream:0: Assertion 'gst_pad_push (pad, buf) == GST_FLOW_OK' failed Running suite(s): selector 77%: Checks: 9, Failures: 2, Errors: 0 I have them failing here.
Created attachment 300193 [details] [review] tests: input-selector: new tests for EOS handling 3 new tests: 1) Tests that a stream that is empty (just an EOS event) on inactive pad doesn't get through and tamper with the active pad that still has data 2) Tests that a stream that is shorter than the active one (pushes EOS earlier) doesn't has its EOS pushed 3) Tests that switching to an inactive stream that has received EOS will make input-selector push EOS
commit ce663311e1f00df5117b0249931e4ac960123cb8 Author: Jan Alexander Steffens (heftig) <jsteffens@make.tv> Date: Mon Mar 23 13:05:30 2015 +0100 input-selector: Fix waiting on EOS This apparently got broken by bc1ec4e. Since self->blocked is always FALSE, gst_input_selector_wait never actually waits. Using (!self->eos || self->blocked) && ... as the loop condition would be incorrect as well, because then the other call to the function in _chain would block until EOS, so the functions cannot be merged trivially. Since blocking is obsolete, gst_input_selector_wait will get removed anyway. As such, just inline the loop. https://bugzilla.gnome.org/show_bug.cgi?id=746518 commit 150e8a5c972fde2275ce93e23402b29a59129a47 Author: Thiago Santos <thiagoss@osg.samsung.com> Date: Fri Mar 20 07:23:53 2015 -0300 tests: input-selector: new tests for EOS handling 3 new tests: 1) Tests that a stream that is empty (just an EOS event) on inactive pad doesn't get through and tamper with the active pad that still has data 2) Tests that a stream that is shorter than the active one (pushes EOS earlier) doesn't has its EOS pushed 3) Tests that switching to an inactive stream that has received EOS will make input-selector push EOS https://bugzilla.gnome.org/show_bug.cgi?id=746518 commit 92d2351b2e97668e00d5d60bddf4123cf293fc9a Author: Thiago Santos <thiagoss@osg.samsung.com> Date: Thu Mar 19 12:11:19 2015 +0000 tests: selector: remove weird semicolons at the end of test functions Even though it works, it is not needed and seems more natural to not have semicolons at the end of function declarations https://bugzilla.gnome.org/show_bug.cgi?id=746518