auparse: fix compiler warnings
authorJordan Petridis <jordan@centricular.com>
Tue, 28 Jul 2020 15:46:30 +0000 (18:46 +0300)
committerJordan Petridis <jordan@centricular.com>
Wed, 29 Jul 2020 16:21:31 +0000 (19:21 +0300)
GCC 10 was complaining like following. It really is complaining about default cases returning
with potentially unitialized *desval, but those cases in the switch should never be hit.

```
 ../subprojects/gst-plugins-good/gst/auparse/gstauparse.c: In function 'gst_au_parse_chain':
../subprojects/gst-plugins-good/gst/auparse/gstauparse.c:481:37: error: 'timestamp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  481 |       GST_BUFFER_TIMESTAMP (outbuf) = timestamp;
../subprojects/gst-plugins-good/gst/auparse/gstauparse.c:482:36: error: 'duration' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  482 |       GST_BUFFER_DURATION (outbuf) = duration;
../subprojects/gst-plugins-good/gst/auparse/gstauparse.c:480:34: error: 'offset' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  480 |       GST_BUFFER_OFFSET (outbuf) = offset;
cc1: all warnings being treated as errors
```

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/671>

gst/auparse/gstauparse.c

index 78d100a..8fbab09 100644 (file)
@@ -417,9 +417,9 @@ gst_au_parse_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
   GstFlowReturn ret = GST_FLOW_OK;
   GstAuParse *auparse;
   gint avail, sendnow = 0;
-  gint64 timestamp;
-  gint64 duration;
-  gint64 offset;
+  gint64 timestamp = 0;
+  gint64 duration = 0;
+  gint64 offset = 0;
 
   auparse = GST_AU_PARSE (parent);