summaryrefslogtreecommitdiff
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
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
-rw-r--r--src/libreal/audio_decoder.c11
-rw-r--r--src/libreal/xine_decoder.c8
2 files changed, 16 insertions, 3 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;
}
diff --git a/src/libreal/xine_decoder.c b/src/libreal/xine_decoder.c
index c120098e7..c19a37a14 100644
--- a/src/libreal/xine_decoder.c
+++ b/src/libreal/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.17 2002/12/17 02:17:26 guenter Exp $
+ * $Id: xine_decoder.c,v 1.18 2002/12/17 02:27:26 guenter Exp $
*
* thin layer to use real binary-only codecs in xine
*
@@ -433,8 +433,12 @@ static void realdec_dispose (video_decoder_t *this_gen) {
printf ("libreal: dispose\n");
#endif
- if (this->rvyuv_free)
+ if (this->context)
+ this->stream->video_out->close(this->stream->video_out, this->stream);
+
+ if (this->rvyuv_free && this->context)
this->rvyuv_free (this->context);
+
if (this->rv_handle)
dlclose (this->rv_handle);