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 744281 - printf: Add support for %I32
printf: Add support for %I32
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Windows
: Normal enhancement
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-02-10 17:37 UTC by Matej Knopp
Modified: 2015-03-12 13:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (847 bytes, patch)
2015-02-10 17:37 UTC, Matej Knopp
none Details | Review

Description Matej Knopp 2015-02-10 17:37:41 UTC
Created attachment 296534 [details] [review]
Patch

libav seems to output some messages with %I32u which can't currently be printed by gstreamer printf
Comment 1 Tim-Philipp Müller 2015-02-10 23:30:06 UTC
Thanks, but what is it that adds those format modifiers? And what GLib version/OS?
Comment 2 Tim-Philipp Müller 2015-03-05 17:37:45 UTC
Matej?
Comment 3 Matej Knopp 2015-03-05 18:10:48 UTC
I'm not sure how glib version is relevant here? Libav decoder logs message with given modifier and gst_debug_message_get uses __gst_vasprintf to print it. Where does glib or OS get into that?

As for what does those modifiers - It's a decoder warning. but i don't remember which decoder exactly and I wasn't able to find it with grep, the printf flags are probably put together in code (in libav).
Comment 4 Tim-Philipp Müller 2015-03-05 18:21:08 UTC
The reason I ask is that I was trying to figure out where that modifier comes from, since I couldn't see glib checking for it or setting it, so I was basically wondering if it was "wrong use" of some sorts or not (defined as not using standard modifiers or glib printf macros) Also, we might want to add more variants.
Comment 5 Matej Knopp 2015-03-05 18:25:41 UTC
I see. So the modifier comes from warning from libav decoder (not sure which one, sorry). It seems to be common on Windows platforms

https://msdn.microsoft.com/en-us/library/tcxf1dw6.aspx  

I don't remember now why I didn't put %I64u there as well.
Comment 6 Tim-Philipp Müller 2015-03-10 10:28:08 UTC
Does this mean this patch is completely untested then? :)
Comment 7 Matej Knopp 2015-03-10 14:08:58 UTC
Not sure what you mean. I tested it when I wrote it. I had a file that gave me decoder warning (from gst-libav) with %I32u in it. I didn't get any %I64u warnings so I didn't implement that :)

But I did test %I32u of course. The only thing is that I don't remember which file it was anymore :)
Comment 8 Tim-Philipp Müller 2015-03-12 13:40:15 UTC
I pushed this without the flags=32, which I think you made up or extrapolated from flags=64 ? (Since it broke the test for me)

commit 0c3f1850be69ec17855dbecb3c55efbd0ccdd9d2
Author: Tim-Philipp Müller <tim@centricular.com>
Date:   Thu Mar 12 13:26:59 2015 +0000

    tests: add some basic unit tests for our printf stuff
    
    To test new %I32 support.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=744281

commit b7f958abad667c0bdca6f2341d2d8e1bb6f7c49d
Author: Matej Knopp <matej.knopp@gmail.com>
Date:   Tue Feb 10 17:40:48 2015 +0100

    printf: add support for %I32
    
    https://bugzilla.gnome.org/show_bug.cgi?id=744281
Comment 9 Matej Knopp 2015-03-12 13:55:07 UTC
Yeah, that sounds like something I might have done. Sorry. Looking at the code now the flags should have remained 0 of course.