summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Roitzsch <mroi@users.sourceforge.net>2003-01-02 12:00:52 +0000
committerMichael Roitzsch <mroi@users.sourceforge.net>2003-01-02 12:00:52 +0000
commit4687c07cf6d10b97451dbc1761ac2103b169dcc7 (patch)
tree88e345072e7084efdfcfd4e0f4f769453f9319ba
parentfe3dac99ac48f4b4ed075120a55c77d0e5d540ef (diff)
downloadxine-lib-4687c07cf6d10b97451dbc1761ac2103b169dcc7.tar.gz
xine-lib-4687c07cf6d10b97451dbc1761ac2103b169dcc7.tar.bz2
make Carsten happy: remove pending SPUs on dispose
CVS patchset: 3751 CVS date: 2003/01/02 12:00:52
-rw-r--r--src/dxr3/dxr3_decode_spu.c11
-rw-r--r--src/dxr3/video_out_dxr3.c17
2 files changed, 25 insertions, 3 deletions
diff --git a/src/dxr3/dxr3_decode_spu.c b/src/dxr3/dxr3_decode_spu.c
index 301d60365..90cfe4bed 100644
--- a/src/dxr3/dxr3_decode_spu.c
+++ b/src/dxr3/dxr3_decode_spu.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: dxr3_decode_spu.c,v 1.28 2002/12/21 12:56:46 miguelfreitas Exp $
+ * $Id: dxr3_decode_spu.c,v 1.29 2003/01/02 12:00:52 mroi Exp $
*/
/* dxr3 spu decoder plugin.
@@ -486,12 +486,21 @@ static void dxr3_spudec_discontinuity(spu_decoder_t *this_gen)
static void dxr3_spudec_dispose(spu_decoder_t *this_gen)
{
+ uint8_t empty_spu[] = {
+ 0x00, 0x26, 0x00, 0x08, 0x80, 0x00, 0x00, 0x80,
+ 0x00, 0x00, 0x00, 0x20, 0x01, 0x03, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x00,
+ 0x00, 0x01, 0x06, 0x00, 0x04, 0x00, 0x07, 0xFF,
+ 0x00, 0x01, 0x00, 0x20, 0x02, 0xFF };
dxr3_spudec_t *this = (dxr3_spudec_t *)this_gen;
#if LOG_SPU
printf("dxr3_decode_spu: close: SPU_FD = %i\n",this->fd_spu);
#endif
pthread_mutex_lock(&this->dxr3_vo->spu_device_lock);
+ /* clear any remaining spu */
+ ioctl(this->fd_spu, EM8300_IOCTL_SPU_BUTTON, NULL);
+ write(this->fd_spu, empty_spu, sizeof(empty_spu));
close(this->fd_spu);
this->fd_spu = 0;
this->dxr3_vo->fd_spu = 0;
diff --git a/src/dxr3/video_out_dxr3.c b/src/dxr3/video_out_dxr3.c
index ecdbc48bd..dd0a0a1e6 100644
--- a/src/dxr3/video_out_dxr3.c
+++ b/src/dxr3/video_out_dxr3.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: video_out_dxr3.c,v 1.65 2002/12/21 12:56:46 miguelfreitas Exp $
+ * $Id: video_out_dxr3.c,v 1.66 2003/01/02 12:00:53 mroi Exp $
*/
/* mpeg1 encoding video out plugin for the dxr3.
@@ -1078,7 +1078,20 @@ static void dxr3_dispose(vo_driver_t *this_gen)
if(this->overlay_enabled)
ioctl(this->fd_control, EM8300_IOCTL_OVERLAY_SETMODE, &val);
close(this->fd_control);
- if (this->fd_spu) close(this->fd_spu);
+ pthread_mutex_lock(&this->spu_device_lock);
+ if (this->fd_spu) {
+ uint8_t empty_spu[] = {
+ 0x00, 0x26, 0x00, 0x08, 0x80, 0x00, 0x00, 0x80,
+ 0x00, 0x00, 0x00, 0x20, 0x01, 0x03, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x00,
+ 0x00, 0x01, 0x06, 0x00, 0x04, 0x00, 0x07, 0xFF,
+ 0x00, 0x01, 0x00, 0x20, 0x02, 0xFF };
+ /* clear any remaining spu */
+ ioctl(this->fd_spu, EM8300_IOCTL_SPU_BUTTON, NULL);
+ write(this->fd_spu, empty_spu, sizeof(empty_spu));
+ close(this->fd_spu);
+ }
+ pthread_mutex_unlock(&this->spu_device_lock);
pthread_mutex_destroy(&this->spu_device_lock);
free(this);
}