summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dxr3/dxr3_decode_spu.c31
-rw-r--r--src/dxr3/video_out_dxr3.c7
2 files changed, 23 insertions, 15 deletions
diff --git a/src/dxr3/dxr3_decode_spu.c b/src/dxr3/dxr3_decode_spu.c
index c1cd84108..dfb4cbf3d 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.19 2002/09/18 15:42:10 mroi Exp $
+ * $Id: dxr3_decode_spu.c,v 1.20 2002/09/27 13:07:43 mroi Exp $
*/
/* dxr3 spu decoder plugin.
@@ -184,19 +184,26 @@ static void dxr3_spudec_init(spu_decoder_t *this_gen, vo_instance_t *vo_out)
int i;
pthread_mutex_lock(&this->dxr3_vo->spu_device_lock);
- /* open dxr3 spu device */
- snprintf(tmpstr, sizeof(tmpstr), "%s_sp%s", this->devname, this->devnum);
- if ((this->fd_spu = open(tmpstr, O_WRONLY)) < 0) {
- printf("dxr3_decode_spu: Failed to open spu device %s (%s)\n",
- tmpstr, strerror(errno));
- return;
- }
+
+ if (this->dxr3_vo->fd_spu)
+ this->fd_spu = this->dxr3_vo->fd_spu;
+ else {
+ /* open dxr3 spu device */
+ snprintf(tmpstr, sizeof(tmpstr), "%s_sp%s", this->devname, this->devnum);
+ if ((this->fd_spu = open(tmpstr, O_WRONLY)) < 0) {
+ printf("dxr3_decode_spu: Failed to open spu device %s (%s)\n",
+ tmpstr, strerror(errno));
+ pthread_mutex_unlock(&this->dxr3_vo->spu_device_lock);
+ return;
+ }
#if LOG_SPU
- printf ("dxr3_decode_spu: init: SPU_FD = %i\n",this->fd_spu);
+ printf ("dxr3_decode_spu: init: SPU_FD = %i\n",this->fd_spu);
#endif
- /* We are talking directly to the dxr3 video out to allow concurrent
- * access to the same spu device */
- this->dxr3_vo->fd_spu = this->fd_spu;
+ /* We are talking directly to the dxr3 video out to allow concurrent
+ * access to the same spu device */
+ this->dxr3_vo->fd_spu = this->fd_spu;
+ }
+
pthread_mutex_unlock(&this->dxr3_vo->spu_device_lock);
for (i=0; i < MAX_SPU_STREAMS; i++) {
diff --git a/src/dxr3/video_out_dxr3.c b/src/dxr3/video_out_dxr3.c
index 693963e2c..63d6db20f 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.55 2002/09/20 12:51:58 mroi Exp $
+ * $Id: video_out_dxr3.c,v 1.56 2002/09/27 13:07:43 mroi Exp $
*/
/* mpeg1 encoding video out plugin for the dxr3.
@@ -665,6 +665,8 @@ static void dxr3_overlay_end(xine_vo_driver_t *this_gen, vo_frame_t *frame_gen)
dxr3_spu_encode(this->spu_enc);
+ pthread_mutex_lock(&this->spu_device_lock);
+
/* try to open the dxr3 spu device */
if (!this->fd_spu) {
snprintf (tmpstr, sizeof(tmpstr), "%s_sp%s", this->devname, this->devnum);
@@ -672,12 +674,11 @@ static void dxr3_overlay_end(xine_vo_driver_t *this_gen, vo_frame_t *frame_gen)
printf("video_out_dxr3: Failed to open spu device %s (%s)\n",
tmpstr, strerror(errno));
printf("video_out_dxr3: Overlays are not available\n");
+ pthread_mutex_unlock(&this->spu_device_lock);
return;
}
}
- pthread_mutex_lock(&this->spu_device_lock);
-
if (!this->spu_enc->overlay) {
uint8_t empty_spu[] = {
0x00, 0x26, 0x00, 0x08, 0x80, 0x00, 0x00, 0x80,