rtpjitterbuffer: Don't use glib format modifiers with sscanf
authorNirbheek Chauhan <nirbheek@centricular.com>
Tue, 25 Feb 2020 15:44:54 +0000 (21:14 +0530)
committerNirbheek Chauhan <nirbheek@centricular.com>
Wed, 26 Feb 2020 13:35:24 +0000 (19:05 +0530)
commit42e7864e90ce40059efc192e375ada9dada15701
tree053bb8601b46a770b15603b6ace494a92b19eeea
parent35a1cedb97c7a5628f0db4776c1851c4ac7a988c
rtpjitterbuffer: Don't use glib format modifiers with sscanf

We do not have a way to know the format modifiers to use with string
functions provided by the system. G_GUINT64_FORMAT and other string
modifiers only work for glib string formatting functions. We cannot
use them for string functions provided by the stdlib. See:
https://developer.gnome.org/glib/stable/glib-Basic-Types.html#glib-Basic-Types.description

```
../gst/rtpmanager/gstrtpjitterbuffer.c: In function 'gst_jitter_buffer_sink_parse_caps':
../gst/rtpmanager/gstrtpjitterbuffer.c:1523:32: error: unknown conversion type character 'l' in format [-Werror=format=]
           || sscanf (mediaclk, "direct=%" G_GUINT64_FORMAT, &clock_offset) != 1)
                                ^~~~~~~~~~
In file included from /home/nirbheek/cerbero/build/dist/windows_x86/include/glib-2.0/glib/gtypes.h:32,
                 from /home/nirbheek/cerbero/build/dist/windows_x86/include/glib-2.0/glib/galloca.h:32,
                 from /home/nirbheek/cerbero/build/dist/windows_x86/include/glib-2.0/glib.h:30,
                 from /home/nirbheek/cerbero/build/dist/windows_x86/include/gstreamer-1.0/gst/gst.h:27,
                 from /home/nirbheek/cerbero/build/dist/windows_x86/include/gstreamer-1.0/gst/rtp/gstrtpbuffer.h:27,
                 from ../gst/rtpmanager/gstrtpjitterbuffer.c:108:
/home/nirbheek/cerbero/build/dist/windows_x86/lib/glib-2.0/include/glibconfig.h:69:28: note: format string is defined here
 #define G_GUINT64_FORMAT "llu"
                            ^
../gst/rtpmanager/gstrtpjitterbuffer.c:1523:32: error: too many arguments for format [-Werror=format-extra-args]
           || sscanf (mediaclk, "direct=%" G_GUINT64_FORMAT, &clock_offset) != 1)
                                ^~~~~~~~~~
```

See also: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/379
gst/rtpmanager/gstrtpjitterbuffer.c