pulse, speexenc, rtpgsmpay: don't use g_assert() for error handling
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Sat, 16 Apr 2011 17:10:24 +0000 (18:10 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Sat, 16 Apr 2011 17:15:43 +0000 (18:15 +0100)
commitf325935314d896cfc65328b904117711e927fba8
treeaf2b8d0fc3e8324d9d2e2d651afe0bdb1c24eeea
parentb005dfea5b885a61e8618ea5ccdc7a4b93e1b39f
pulse, speexenc, rtpgsmpay: don't use g_assert() for error handling

Don't use g_assert() for error handling, even if they're highly unlikely.
Either we *know* that something can't happen, in which case we
should just not handle it, or we think something can happen, but it is
very very unlikely that it will ever happen, in which case we should
handle it like any other error instead of asserting.

g_assert() is best left for conditions we have control of, like checking
internal consistency of our code, not checking return values of external
code.

Fixes a bunch of warnings when compiling with -DG_DISABLE_ASSERT:
gstrtpgsmpay.c: In function 'gst_rtp_gsm_pay_handle_buffer':
gstrtpgsmpay.c:130:17: warning: variable 'rtpgsmpay' set but not used
gstspeexenc.c: In function 'gst_speex_enc_encode':
gstspeexenc.c:904:19: warning: variable 'written' set but not used
pulsesink.c: In function 'gst_pulsesink_change_state':
pulsesink.c:2725:9: warning: variable 'res' set but not used
pulsesrc.c: In function 'gst_pulsesrc_change_state':
pulsesrc.c:1253:7: warning: variable 'e' set but not used
ext/pulse/pulsesink.c
ext/pulse/pulsesrc.c
ext/speex/gstspeexenc.c
gst/rtp/gstrtpgsmpay.c