element: set pads need-parent flag to false when removing
authorThiago Santos <ts.santos@sisa.samsung.com>
Thu, 29 May 2014 17:07:15 +0000 (14:07 -0300)
committerThiago Santos <ts.santos@sisa.samsung.com>
Thu, 29 May 2014 20:01:20 +0000 (17:01 -0300)
commit1911554cff2c4a11772b541a8215a80c728b1097
treea0491565b17ba5157f36d3fd3d8f3321e5c2e0cb
parent01c9ae26309cdf4ce0876ae878e5a72e7fcc7f54
element: set pads need-parent flag to false when removing

When a pad is added the need-parent flag is set to true, so when
they are removed the flag should be set back to false

This was preventing GstPads to be reused in elements (removed and
later re-added). A unit tests was added to verify that this is
working now.

The use case is tsdemux that has a program-number property and
allows the user to switch programs. In order to do that tsdemux
will remove the pads of the current program and add from the new
ones. The removed pads are kept in the demuxer for later if the
user selects the old program again.
gst/gstelement.c
tests/check/gst/gstelement.c