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 756065 - audioaggregator: fix build error
audioaggregator: fix build error
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 1.6.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-10-04 23:46 UTC by Vineeth
Modified: 2015-10-07 18:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix build error (1.07 KB, patch)
2015-10-04 23:47 UTC, Vineeth
none Details | Review
fix build error (3.66 KB, patch)
2015-10-06 23:52 UTC, Vineeth
committed Details | Review

Description Vineeth 2015-10-04 23:46:14 UTC
Build error due to wrong argument type in debug message

gstaudioaggregator.c:1142:5: error: format '%lu' expects argument of type 'long unsigned int', but argument 8 has type 'gint64' [-Werror=format=]
     GST_DEBUG_OBJECT (aagg, "Starting at offset %lu", aagg->priv->offset);
Comment 1 Vineeth 2015-10-04 23:47:01 UTC
Created attachment 312654 [details] [review]
fix build error
Comment 2 Nicolas Dufresne (ndufresne) 2015-10-05 00:07:38 UTC
Review of attachment 312654 [details] [review]:

::: gst/audiomixer/gstaudioaggregator.c
@@ +1141,3 @@
         GST_SECOND);
+    GST_DEBUG_OBJECT (aagg, "Starting at offset %" G_GUINT64_FORMAT,
+        aagg->priv->offset);

Offset is a gint64, you are using the guint64 formatter here.
Comment 3 Vineeth 2015-10-05 00:15:46 UTC
Actually, there seems to quite a lot of mismatch for gint64 and guint64 in audioaggregator..


guint64 output_offset;
guint64 next_offset;

these two are declared as unsigned..

But it is being assigned
  pad->priv->output_offset = -1;
  pad->priv->next_offset = -1;
at a lot of places..


Should all the offset values be changed to signed int64?
Comment 4 Vineeth 2015-10-05 00:32:41 UTC
but buffer offset is uint64 -- GST_BUFFER_OFFSET()

And we are assigning signed values to unsigned value
    GST_BUFFER_OFFSET (outbuf) = aagg->priv->offset;

Probably we should maintain some consistency? guess uint64 everywhere? :)
Comment 5 Nicolas Dufresne (ndufresne) 2015-10-05 10:18:31 UTC
I was just commenting on the correctness of your patch, but if you feel like cleaning this up that would be nice.

In general guint64 shall be used, unless we hold a delta that can be negative. Just like for timestamp, -1 assigned to a guint64 is a lazy way to obtain G_MAXUINT64. An example is the timestamp:

#define GST_CLOCK_TIME_NONE             ((GstClockTime) -1)
Comment 6 Sebastian Dröge (slomo) 2015-10-05 10:57:49 UTC
Use G_GINT64_FORMAT here, the -1 assignments are correct as Nicolas says.
Comment 7 Vineeth 2015-10-05 11:57:58 UTC
Thanks for the clarification..

Actually in the same function there is another log where guint64 format is being used for offset(int64 variable)..
And 3-4 other places in the file.. 

I wont hv access to system to make changes till Wednesday..
So please feel free to commit a new patch making the changes ... sorry about that :)
Comment 8 Sebastian Dröge (slomo) 2015-10-05 12:56:56 UTC
No problem, we can wait for you :) What compiler/platform is that btw, it doesn't cause any warnings here.
Comment 9 Vineeth 2015-10-06 23:52:24 UTC
Created attachment 312774 [details] [review]
fix build error

Along with build error, change from uint64 formatter to int64 formatter for int64 variables
Comment 10 Vineeth 2015-10-07 07:42:56 UTC
by the way, i am using gst un-installed setup in ubuntu 14.04 32 bit machine
Comment 11 Sebastian Dröge (slomo) 2015-10-07 10:21:27 UTC
commit 3b89dd4768c15e31a80a815d16f0899abf8818ad
Author: Vineeth TM <vineeth.tm@samsung.com>
Date:   Wed Oct 7 08:48:15 2015 +0900

    audioaggregator: Fix build error
    
    Build error due to wrong argument type in debug message
    aagg->priv->offset and next_offset are of type int64, but uint64
    formatter is being used in logs. Changing all those to int64
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756065