diff options
author | Josep Torra <n770galaxy@gmail.com> | 2016-07-24 10:00:48 +0200 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2016-11-20 11:48:21 +0000 |
commit | badd21f5fe4b685705b47cc4600f25f3ef2dbbc4 (patch) | |
tree | 54ffa048336be8b825be2357a9d105ca0bd3dff3 | |
parent | b49636b15c8d2fc36bb4a728f81aeca1d9e641d5 (diff) | |
download | gstreamer-plugins-ugly-1.8.tar.gz |
sidplay: fix compiler warnings when building with -O31.8
Avoid compiler warnings "‘foo’ may be used uninitialized in this
function" when building with -O3 by checking the return bool value
of format conversion function.
https://bugzilla.gnome.org/show_bug.cgi?id=769116
-rw-r--r-- | ext/sidplay/gstsiddec.cc | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/ext/sidplay/gstsiddec.cc b/ext/sidplay/gstsiddec.cc index f06ed9fd..b8d62c13 100644 --- a/ext/sidplay/gstsiddec.cc +++ b/ext/sidplay/gstsiddec.cc @@ -21,15 +21,15 @@ /** * SECTION:element-siddec * - * This element decodes .sid files to raw audio. .sid files are in fact - * small Commodore 64 programs that are executed on an emulated 6502 CPU and a + * This element decodes .sid files to raw audio. .sid files are in fact + * small Commodore 64 programs that are executed on an emulated 6502 CPU and a * MOS 6581 sound chip. - * + * * This plugin will first load the complete program into memory before starting * the emulator and producing output. - * + * * Seeking is not (and cannot be) implemented. - * + * * <refsect2> * <title>Example pipelines</title> * |[ @@ -396,7 +396,7 @@ play_loop (GstPad * pad) GstSidDec *siddec; GstBuffer *out; GstMapInfo outmap; - gint64 value, offset, time; + gint64 value, offset, time = 0; GstFormat format; siddec = GST_SIDDEC (gst_pad_get_parent (pad)); @@ -410,29 +410,29 @@ play_loop (GstPad * pad) /* get offset in samples */ format = GST_FORMAT_DEFAULT; - gst_siddec_src_convert (siddec->srcpad, - GST_FORMAT_BYTES, siddec->total_bytes, &format, &offset); - GST_BUFFER_OFFSET (out) = offset; + if (gst_siddec_src_convert (siddec->srcpad, + GST_FORMAT_BYTES, siddec->total_bytes, &format, &offset)) + GST_BUFFER_OFFSET (out) = offset; /* get current timestamp */ format = GST_FORMAT_TIME; - gst_siddec_src_convert (siddec->srcpad, - GST_FORMAT_BYTES, siddec->total_bytes, &format, &time); - GST_BUFFER_TIMESTAMP (out) = time; + if (gst_siddec_src_convert (siddec->srcpad, + GST_FORMAT_BYTES, siddec->total_bytes, &format, &time)) + GST_BUFFER_TIMESTAMP (out) = time; /* update position and get new timestamp to calculate duration */ siddec->total_bytes += siddec->blocksize; /* get offset in samples */ format = GST_FORMAT_DEFAULT; - gst_siddec_src_convert (siddec->srcpad, - GST_FORMAT_BYTES, siddec->total_bytes, &format, &value); - GST_BUFFER_OFFSET_END (out) = value; + if (gst_siddec_src_convert (siddec->srcpad, + GST_FORMAT_BYTES, siddec->total_bytes, &format, &value)) + GST_BUFFER_OFFSET_END (out) = value; format = GST_FORMAT_TIME; - gst_siddec_src_convert (siddec->srcpad, - GST_FORMAT_BYTES, siddec->total_bytes, &format, &value); - GST_BUFFER_DURATION (out) = value - time; + if (gst_siddec_src_convert (siddec->srcpad, + GST_FORMAT_BYTES, siddec->total_bytes, &format, &value)) + GST_BUFFER_DURATION (out) = value - time; if ((ret = gst_pad_push (siddec->srcpad, out)) != GST_FLOW_OK) goto pause; |