uridownloader: make cancelled state 'permanent' until a reset
authorAndre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk>
Tue, 16 Apr 2013 20:23:02 +0000 (17:23 -0300)
committerThiago Santos <thiago.sousa.santos@collabora.com>
Tue, 7 May 2013 23:02:41 +0000 (20:02 -0300)
commitf72869816c543ef9c01abdd79fecf63a1ba2fbec
treef38d6765d6492ef3a9bdfd0ad6dc731c5d19ef6d
parent859635ca0102bc286d1d8633d2688efb9bb4fae9
uridownloader: make cancelled state 'permanent' until a reset

When downloading and cancelling quickly the uridownloader object and the
element using it could miss the cancelled window and the uridownloader
would fetch the wrong URI and block on subsequent fetches.

This was also problematic when stopping elements, while one task would
call the cancel, another element thread could issue a new fetch_uri. As
the cancel state isn't 'permanent' this fetch_uri would block and
prevent the whole element from stopping and going to NULL.

This patch makes the 'cancelled' state permanent until a
gst_uri_downloader_reset is called. This way the element knows the
window where the uridownloader isn't active and only reactivate it when
ready.
gst-libs/gst/uridownloader/gsturidownloader.c
gst-libs/gst/uridownloader/gsturidownloader.h