summaryrefslogtreecommitdiff
path: root/src/libreal/audio_decoder.c
diff options
context:
space:
mode:
authorGuenter Bartsch <guenter@users.sourceforge.net>2002-12-17 02:27:26 +0000
committerGuenter Bartsch <guenter@users.sourceforge.net>2002-12-17 02:27:26 +0000
commit826c9bebacbfb70b455f1c8332217fdfcf8d2cd3 (patch)
treef60e22bb8f526137efbb425aa34710482eabb93e /src/libreal/audio_decoder.c
parent076c360a8404424ac173100973595bda6dc6b158 (diff)
downloadxine-lib-826c9bebacbfb70b455f1c8332217fdfcf8d2cd3.tar.gz
xine-lib-826c9bebacbfb70b455f1c8332217fdfcf8d2cd3.tar.bz2
close output on dispose
CVS patchset: 3571 CVS date: 2002/12/17 02:27:26
Diffstat (limited to 'src/libreal/audio_decoder.c')
-rw-r--r--src/libreal/audio_decoder.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/libreal/audio_decoder.c b/src/libreal/audio_decoder.c
index f7fcdfbe5..5a160a771 100644
--- a/src/libreal/audio_decoder.c
+++ b/src/libreal/audio_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: audio_decoder.c,v 1.12 2002/12/17 02:17:25 guenter Exp $
+ * $Id: audio_decoder.c,v 1.13 2002/12/17 02:27:26 guenter Exp $
*
* thin layer to use real binary-only codecs in xine
*
@@ -83,6 +83,8 @@ typedef struct realdec_decoder_s {
uint64_t pts;
+ int output_open;
+
} realdec_decoder_t;
typedef struct {
@@ -398,6 +400,8 @@ static int init_codec (realdec_decoder_t *this, buf_element_t *buf) {
samples_per_sec,
mode) ;
+ this->output_open = 1;
+
this->sample_size = num_channels * (bits_per_sample>>3);
return 1;
@@ -618,6 +622,9 @@ static void realdec_dispose (audio_decoder_t *this_gen) {
if (this->ra_handle)
dlclose (this->ra_handle);
+ if (this->output_open)
+ this->stream->audio_out->close (this->stream->audio_out, this->stream);
+
if (this->frame_buffer)
free (this->frame_buffer);
@@ -644,6 +651,8 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen,
this->stream = stream;
this->cls = cls;
+ this->output_open = 0;
+
return &this->audio_decoder;
}