summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Courtier-Dutton <jcdutton@users.sourceforge.net>2001-09-11 14:10:04 +0000
committerJames Courtier-Dutton <jcdutton@users.sourceforge.net>2001-09-11 14:10:04 +0000
commit8580a7e3f20c34fb62ff93d41f6c9ea3a814aa2d (patch)
treed95195491d7e486395a4519c69f1eb5777d0f525
parent0e0c98d86ad0bd0671b6060bff333834d1d29e92 (diff)
downloadxine-lib-8580a7e3f20c34fb62ff93d41f6c9ea3a814aa2d.tar.gz
xine-lib-8580a7e3f20c34fb62ff93d41f6c9ea3a814aa2d.tar.bz2
Fix some Floating point exceptions
Document return values of audio_out.c:open CVS patchset: 615 CVS date: 2001/09/11 14:10:04
-rw-r--r--src/liba52/xine_decoder.c10
-rw-r--r--src/liblpcm/xine_decoder.c6
-rw-r--r--src/libmad/xine_decoder.c18
-rw-r--r--src/xine-engine/audio_out.c4
-rw-r--r--src/xine-engine/audio_out.h3
5 files changed, 23 insertions, 18 deletions
diff --git a/src/liba52/xine_decoder.c b/src/liba52/xine_decoder.c
index fd2c3c629..877eb5f43 100644
--- a/src/liba52/xine_decoder.c
+++ b/src/liba52/xine_decoder.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine_decoder.c,v 1.2 2001/09/03 21:50:15 guenter Exp $
+ * $Id: xine_decoder.c,v 1.3 2001/09/11 14:10:04 jcdutton Exp $
*
* stuff needed to turn liba52 into a xine decoder plugin
*/
@@ -247,9 +247,9 @@ static void a52dec_decode_frame (a52dec_decoder_t *this, uint32_t pts) {
this->audio_out->close (this->audio_out);
- this->output_open = (this->audio_out->open (this->audio_out, 16,
+ this->output_open = this->audio_out->open (this->audio_out, 16,
this->a52_sample_rate,
- output_mode) == 1);
+ output_mode) ;
this->output_sampling_rate = this->a52_sample_rate;
this->output_mode = output_mode;
}
@@ -323,9 +323,9 @@ static void a52dec_decode_frame (a52dec_decoder_t *this, uint32_t pts) {
a52_syncinfo (this->frame_buffer, &flags, &sample_rate, &bit_rate);
- this->output_open = (this->audio_out->open (this->audio_out, 16,
+ this->output_open = this->audio_out->open (this->audio_out, 16,
sample_rate,
- AO_CAP_MODE_A52) == 1);
+ AO_CAP_MODE_A52) ;
this->output_mode = AO_CAP_MODE_A52;
}
diff --git a/src/liblpcm/xine_decoder.c b/src/liblpcm/xine_decoder.c
index 62698bacc..4b4ba8b5d 100644
--- a/src/liblpcm/xine_decoder.c
+++ b/src/liblpcm/xine_decoder.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine_decoder.c,v 1.8 2001/09/10 03:04:48 guenter Exp $
+ * $Id: xine_decoder.c,v 1.9 2001/09/11 14:10:04 jcdutton Exp $
*
* 31-8-2001 Added LPCM rate sensing.
* (c) 2001 James Courtier-Dutton James@superbug.demon.co.uk
@@ -94,9 +94,9 @@ void lpcm_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
if (!this->output_open) {
printf ("liblpcm: opening audio output (%d Hz sampling rate, mode=%d)\n",
this->rate, this->ao_cap_mode);
- this->output_open = (this->audio_out->open (this->audio_out, this->bits_per_sample,
+ this->output_open = this->audio_out->open (this->audio_out, this->bits_per_sample,
this->rate,
- this->ao_cap_mode) == 1);
+ this->ao_cap_mode) ;
}
if (!this->output_open)
return;
diff --git a/src/libmad/xine_decoder.c b/src/libmad/xine_decoder.c
index 94ce433e5..3e5ee3cf9 100644
--- a/src/libmad/xine_decoder.c
+++ b/src/libmad/xine_decoder.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine_decoder.c,v 1.5 2001/09/06 13:36:18 jkeil Exp $
+ * $Id: xine_decoder.c,v 1.6 2001/09/11 14:10:04 jcdutton Exp $
*
* stuff needed to turn libmad into a xine decoder plugin
*/
@@ -169,13 +169,17 @@ static void mad_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
this->frame.header.samplerate,
mode);
- if (this->output_open)
+ if (this->output_open) {
this->audio_out->close (this->audio_out);
-
- this->output_open = (this->audio_out->open(this->audio_out, 16,
- this->frame.header.samplerate,
- mode) == 1);
-
+ }
+ if (!this->output_open) {
+ this->output_open = this->audio_out->open(this->audio_out, 16,
+ this->frame.header.samplerate,
+ mode) ;
+ }
+ if (!this->output_open) {
+ return;
+ }
this->output_sampling_rate = this->frame.header.samplerate;
this->output_mode = mode;
}
diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c
index 4df9082b3..578847af3 100644
--- a/src/xine-engine/audio_out.c
+++ b/src/xine-engine/audio_out.c
@@ -17,7 +17,7 @@
* along with self program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: audio_out.c,v 1.14 2001/09/10 21:52:59 guenter Exp $
+ * $Id: audio_out.c,v 1.15 2001/09/11 14:10:04 jcdutton Exp $
*
* 22-8-2001 James imported some useful AC3 sections from the previous alsa driver.
* (c) 2001 Andy Lo A Foe <andy@alsaplayer.org>
@@ -169,7 +169,7 @@ static int ao_open(ao_instance_t *this,
this->metronom->set_audio_rate(this->metronom, this->audio_step);
- return 1;
+ return this->output_frame_rate;
}
static void ao_fill_gap (ao_instance_t *this, uint32_t pts_len) {
diff --git a/src/xine-engine/audio_out.h b/src/xine-engine/audio_out.h
index 83a18a1ce..c6addcfb9 100644
--- a/src/xine-engine/audio_out.h
+++ b/src/xine-engine/audio_out.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: audio_out.h,v 1.14 2001/09/10 03:04:48 guenter Exp $
+ * $Id: audio_out.h,v 1.15 2001/09/11 14:10:04 jcdutton Exp $
*/
#ifndef HAVE_AUDIO_OUT_H
#define HAVE_AUDIO_OUT_H
@@ -127,6 +127,7 @@ struct ao_instance_s {
uint32_t (*get_capabilities) (ao_instance_t *this); /* for constants see below */
/* open audio driver for audio output */
+ * return value: 0:failure, >0:output sample rate
int (*open) (ao_instance_t *this,
uint32_t bits, uint32_t rate, int mode);