[Server] Fix a crash case when the server stops

Signed-off-by: Regis Merlino <regis.merlino@intel.com>
[Cleanup] Removed unused include.

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
[Documentation] Fixed a few bugs in the documentation.

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
[Klockwork] NULL pointer may be dereferenced. (#24)

    Fix issue #24: ip_address may be NULL and may be dereferenced.

Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
[Klockwork] NULL pointer may be dereferenced. (#25)

Fix issue #25: ip_address may be NULL and may be dereferenced.

Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
[Cleanup] Code cleanup after code review

- Don't initialize result in task creation.
Avoid specific cases. It doesn't make the code more readable, nor smaller.

- if/else cleaning.
Make default action in if statement, and error management in else statement.
Most common usage.

- Factorize code.
Move same function call from each switch/case, outside the switch.
Reduce code.

Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
[Device] GetAll: do not fail if the DMR returns an error for GetPositionInfo

Fix issue 92: <https://github.com/01org/dleyna-renderer/issues/92>

Signed-off-by: Regis Merlino <regis.merlino@intel.com>
[Server] Fix a crash case for Rescan()

Signed-off-by: Regis Merlino <regis.merlino@intel.com>
[Device] Fix #78: MPRIS OpenUri() does not start playing

Fix issue #78: <https://github.com/01org/dleyna-renderer/issues/78>

Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
[API] Issue #94: Add new SetUri API to Player

Fix issue #94: <https://github.com/01org/dleyna-renderer/issues/94>

Do the same as OpenUriEx, except it doesn't excecute the Play
command.

Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
[Coding Convention] CheckPatch [3.8.0.26]

NOTE: Ignored message types: CAMELCASE NEW_TYPEDEFS PREFER_PRINTF

Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
[Player] Add OpenNextUri() method

Based on original work from Sébastien Bianti <sebastien.bianti@linux.intel.com>

- Resolves bug #35
- Documentation updated.

Signed-off-by: Regis Merlino <regis.merlino@intel.com>
[Server] Update following the publish_object() connector API change

Signed-off-by: Regis Merlino <regis.merlino@intel.com>
[Introspection] Fixed bug 97

The fix is nasty but I can't see any other way to fix the issue
without having to change dleyna-core and GUPnP.  This will have
to be done anyway at some point but in the meantime this is a
serious bug that needs to be patched ASAP.

The fix works as follows:

1. We use a weak refererence to detect if we have lost our renderer
during a call to gupnp_service_info_get_introspection.  If we have
we return control direcly to the main loop failing any task and
making sure we do not access the device object.

2. We make sure that gupnp_service_info_get_introspection is not called
inside an event callback from GUPnP.  Otherwise changes to the list of
devices in our callback can result in a crash when we return control back
to GUPnP.

Long term we need to retrieve introspection information asynchronously
during device construction and not during calls to GetProp or in
event handlers.  We might has well initialise the properties during
device construction as well.  This will simplify the code.  Before
this can be done however, we need a way to cancel
gupnp_service_info_get_introspection_async and a way to call this
function inside a task queue.

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
[Renderer] Enable byte seek

Based on original work from Sebastien Bianti <sebastien.bianti@linux.intel.com>

- Resolves issue #59
- Documentation updated.

Signed-off-by: Regis Merlino <regis.merlino@intel.com>
[Player] Fix OpenUri() after changes in commit bea7776

Commit bea7776 introduced a generic mechanism in dlr_task_open_uri_t
where callers are supposed to set the desired operation and URI type in
the stask data struct, but OpenUri() was not updated to do so.

Calls to OpenUri() would then result in calls to
gupnp_service_proxy_begin_action() with a NULL operation in
dlr_device_open_uri(), which would not trigger the callback at all and
ultimately result in the original DBus call to timeout.

Signed-off-by: Emanuele Aina <emanuele.aina@collabora.com>
[Debug] Print the error message on failed tasks, not just the pointer

Signed-off-by: Emanuele Aina <emanuele.aina@collabora.com>
[Build] Fix small typo in the summary at the end of configure.ac

Signed-off-by: Emanuele Aina <emanuele.aina@collabora.com>
[Build] Ship the internal library in a private directory

The libdleyna-renderer-1.0.so library is not really meant for public
consumption and it's just an internal implementation detail.

To prevent any confusion, ship it in a package-specific subdirectory of
the configured libdir.

Signed-off-by: Emanuele Aina <emanuele.aina@collabora.com>