mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 09:40:37 +00:00
sidplay: fix compiler warnings when building with -O3
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
This commit is contained in:
parent
61f8ac49cc
commit
9b6b6d1fd5
1 changed files with 18 additions and 18 deletions
|
@ -394,7 +394,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));
|
||||
|
@ -408,14 +408,14 @@ 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);
|
||||
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);
|
||||
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 */
|
||||
|
@ -423,13 +423,13 @@ 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, &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);
|
||||
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)
|
||||
|
|
Loading…
Reference in a new issue