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 788520 - device-provider: gst_device_provider_unhide_provider() always fails
device-provider: gst_device_provider_unhide_provider() always fails
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
1.12.3
Other All
: Normal normal
: 1.12.4
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-10-04 16:03 UTC by Ashish Kumar
Modified: 2017-10-05 08:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix the issue attached (741 bytes, patch)
2017-10-05 05:01 UTC, Ashish Kumar
committed Details | Review

Description Ashish Kumar 2017-10-04 16:03:50 UTC
In 
File: gstdeviceprovider.c 
Function: gst_device_provider_unhide_provider
Line no.:717

Condition 'unhidden_name!=0' is always false resulting in function always returning error.

---------------------
void
gst_device_provider_unhide_provider (GstDeviceProvider * provider,
    const gchar * name)
{
  GList *find;
  gchar *unhidden_name = NULL;

  g_return_if_fail (GST_IS_DEVICE_PROVIDER (provider));
  g_return_if_fail (unhidden_name != NULL);
----------------------

 g_return_if_fail: is used for verifying that the expression (usually representing a precondition) evaluates to TRUE.
Hence, the control will never go down the function.

Solution : Remove statement 
  g_return_if_fail (unhidden_name != NULL);
Comment 1 Nicolas Dufresne (ndufresne) 2017-10-04 16:15:02 UTC
(In reply to Ashish Kumar from comment #0)
> Solution : Remove statement 
>   g_return_if_fail (unhidden_name != NULL);

No, the assert was suppose to check the "name" variable. Clearly though this code was never tested / reached.
Comment 2 Ashish Kumar 2017-10-04 16:48:48 UTC
Can I submit a patch ?
Comment 3 Nicolas Dufresne (ndufresne) 2017-10-04 18:35:01 UTC
Of course, it's always pretty appreciated. If you have the time to actually test this feature, that would be even better.
Comment 4 Ashish Kumar 2017-10-05 05:01:29 UTC
Created attachment 360945 [details] [review]
Patch to fix the issue attached

Please review the attached patch and share the feedback.
Comment 5 Tim-Philipp Müller 2017-10-05 08:46:30 UTC
Thanks, pushed:

commit 0ca70247fc4ebca257e9f911997a7bee820d4468 (HEAD -> master)
Author: Ashish Kumar <kr.ashish@samsung.com>
Date:   Thu Oct 5 10:24:24 2017 +0530

    device-provider: gst_device_provider_unhide_provider() always fails
    
    https://bugzilla.gnome.org/show_bug.cgi?id=788520