After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 740365 - namespace getters in GUPnPDIDLLiteObject are broken
namespace getters in GUPnPDIDLLiteObject are broken
Status: RESOLVED FIXED
Product: gupnp-av
Classification: Other
Component: General
0.20.x
Other Linux
: Normal normal
: ---
Assigned To: GUPnP Maintainers
GUPnP Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-11-19 13:48 UTC by Sven Neumann
Modified: 2019-02-22 05:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
add units test for GUPnPDIDLLiteObject namespace (3.19 KB, patch)
2014-11-19 13:50 UTC, Sven Neumann
committed Details | Review
gupnp-didl-lite-object: fix namespace getters (2.19 KB, patch)
2014-11-19 13:51 UTC, Sven Neumann
committed Details | Review

Description Sven Neumann 2014-11-19 13:48:06 UTC
GUPnPDIDLLiteObject has getters for the XML namespaces:

gupnp_didl_lite_object_get_upnp_namespace()
gupnp_didl_lite_object_get_dc_namespace()
gupnp_didl_lite_object_get_dlna_namespace()
gupnp_didl_lite_object_get_pv_namespace()

These are intented for third-party code that needs access to these namespaces in order to enrich the DIDL-Lite XML fragment.

With the changes that went into 0.12.6 the namespace handling was changed considerably so that namespaces are now created lazily. This creates two problems:

(1) The namespace getters will return NULL if they are used before another
    internal function has created the namespace.
(2) The optimization that namespaces are not created for each object but
    shared across all objects created by the same GUPnPDIDLLiteWriter is gone.

I am attaching two patches. One adds a unit test for the namespace getters. The second patch fixes problem (1). Problem (2) remains open for now, but it's just a missing optimization and does not really count as a bug. So it has lower priority and can be addressed later.
Comment 1 Sven Neumann 2014-11-19 13:50:29 UTC
Created attachment 290998 [details] [review]
add units test for GUPnPDIDLLiteObject namespace
Comment 2 Sven Neumann 2014-11-19 13:51:05 UTC
Created attachment 290999 [details] [review]
gupnp-didl-lite-object: fix namespace getters
Comment 3 Jens Georg 2014-11-20 07:47:12 UTC
Review of attachment 290999 [details] [review]:

+1
Comment 4 Jens Georg 2014-11-20 07:47:28 UTC
Review of attachment 290998 [details] [review]:

+1