diff options
author | Thibault Saunier <thibault.saunier@collabora.com> | 2012-03-10 19:10:52 -0300 |
---|---|---|
committer | Thibault Saunier <thibault.saunier@collabora.com> | 2012-03-10 19:22:07 -0300 |
commit | 20669d461a4953eb5ed01374d5ab628b4dc73b64 (patch) | |
tree | 5647a44580eba66f6b360066f90406f0779f121f /gst/aiff | |
parent | a7eda9ed4942e24f0a3971c3591af54cc4cd9a5b (diff) |
Fix 'ignoring return value of function declared with const attribute'
This always happens with GstByteReader/Writer and friends when
not taking into account returned boolean of the _read/_write functions
(which is actually wrong).
Make use of the *_unchecked variant as much as possible, or take the
returned value into account.
Diffstat (limited to 'gst/aiff')
-rw-r--r-- | gst/aiff/aiffmux.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/gst/aiff/aiffmux.c b/gst/aiff/aiffmux.c index 0d2772af5..565ea8629 100644 --- a/gst/aiff/aiffmux.c +++ b/gst/aiff/aiffmux.c @@ -163,11 +163,14 @@ gst_aiff_mux_write_form_header (GstAiffMux * aiffmux, guint32 audio_data_size, GstByteWriter * writer) { /* ckID == 'FORM' */ - gst_byte_writer_put_uint32_le (writer, GST_MAKE_FOURCC ('F', 'O', 'R', 'M')); + gst_byte_writer_put_uint32_le_unchecked (writer, + GST_MAKE_FOURCC ('F', 'O', 'R', 'M')); /* ckSize is currently bogus but we'll know what it is later */ - gst_byte_writer_put_uint32_be (writer, audio_data_size + AIFF_HEADER_LEN - 8); + gst_byte_writer_put_uint32_be_unchecked (writer, + audio_data_size + AIFF_HEADER_LEN - 8); /* formType == 'AIFF' */ - gst_byte_writer_put_uint32_le (writer, GST_MAKE_FOURCC ('A', 'I', 'F', 'F')); + gst_byte_writer_put_uint32_le_unchecked (writer, + GST_MAKE_FOURCC ('A', 'I', 'F', 'F')); } /* @@ -218,8 +221,8 @@ gst_aiff_mux_write_ext (GstByteWriter * writer, double d) if (d < 0) ext.exponent[0] |= 0x80; - gst_byte_writer_put_data (writer, ext.exponent, 2); - gst_byte_writer_put_data (writer, ext.mantissa, 8); + gst_byte_writer_put_data_unchecked (writer, ext.exponent, 2); + gst_byte_writer_put_data_unchecked (writer, ext.mantissa, 8); } /* @@ -230,13 +233,14 @@ static void gst_aiff_mux_write_comm_header (GstAiffMux * aiffmux, guint32 audio_data_size, GstByteWriter * writer) { - gst_byte_writer_put_uint32_le (writer, GST_MAKE_FOURCC ('C', 'O', 'M', 'M')); - gst_byte_writer_put_uint32_be (writer, 18); - gst_byte_writer_put_uint16_be (writer, aiffmux->channels); + gst_byte_writer_put_uint32_le_unchecked (writer, + GST_MAKE_FOURCC ('C', 'O', 'M', 'M')); + gst_byte_writer_put_uint32_be_unchecked (writer, 18); + gst_byte_writer_put_uint16_be_unchecked (writer, aiffmux->channels); /* numSampleFrames value will be overwritten when known */ - gst_byte_writer_put_uint32_be (writer, + gst_byte_writer_put_uint32_be_unchecked (writer, audio_data_size / (aiffmux->width / 8 * aiffmux->channels)); - gst_byte_writer_put_uint16_be (writer, aiffmux->depth); + gst_byte_writer_put_uint16_be_unchecked (writer, aiffmux->depth); gst_aiff_mux_write_ext (writer, aiffmux->rate); } @@ -244,13 +248,14 @@ static void gst_aiff_mux_write_ssnd_header (GstAiffMux * aiffmux, guint32 audio_data_size, GstByteWriter * writer) { - gst_byte_writer_put_uint32_le (writer, GST_MAKE_FOURCC ('S', 'S', 'N', 'D')); + gst_byte_writer_put_uint32_le_unchecked (writer, + GST_MAKE_FOURCC ('S', 'S', 'N', 'D')); /* ckSize will be overwritten when known */ - gst_byte_writer_put_uint32_be (writer, + gst_byte_writer_put_uint32_be_unchecked (writer, audio_data_size + AIFF_SSND_HEADER_LEN - 8); /* offset and blockSize are set to 0 as we don't support block-aligned sample data yet */ - gst_byte_writer_put_uint32_be (writer, 0); - gst_byte_writer_put_uint32_be (writer, 0); + gst_byte_writer_put_uint32_be_unchecked (writer, 0); + gst_byte_writer_put_uint32_be_unchecked (writer, 0); } static GstFlowReturn |