summaryrefslogtreecommitdiff
path: root/src/libspudec
diff options
context:
space:
mode:
Diffstat (limited to 'src/libspudec')
-rw-r--r--src/libspudec/spu.c6
-rw-r--r--src/libspudec/spu_decoder_api.h6
-rw-r--r--src/libspudec/xine_decoder.c20
3 files changed, 30 insertions, 2 deletions
diff --git a/src/libspudec/spu.c b/src/libspudec/spu.c
index b302ce9dc..da1aedfcd 100644
--- a/src/libspudec/spu.c
+++ b/src/libspudec/spu.c
@@ -35,7 +35,7 @@
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: spu.c,v 1.45 2002/09/04 23:31:10 guenter Exp $
+ * $Id: spu.c,v 1.46 2002/09/18 04:20:09 jcdutton Exp $
*
*/
@@ -338,6 +338,10 @@ void spudec_process (spudec_decoder_t *this, uint32_t stream_id) {
spu_event.event.type = XINE_EVENT_INPUT_BUTTON_FORCE;
spu_event.data = &spu_button;
spu_button.buttonN = this->buttonN;
+ /* The BUTTON_FORCE event cannot call "get_nav_pci",
+ so the nav_pci info has to be passed in the event instead. */
+ /* FIXME: the dxr3 code will have to be updated. */
+ memcpy(&spu_button.nav_pci, &this->pci, sizeof(pci_t) );
xine_send_event(this->xine, &spu_event.event);
}
#ifdef LOG_BUTTON
diff --git a/src/libspudec/spu_decoder_api.h b/src/libspudec/spu_decoder_api.h
index a03e02621..19575a505 100644
--- a/src/libspudec/spu_decoder_api.h
+++ b/src/libspudec/spu_decoder_api.h
@@ -25,6 +25,9 @@
#define HAVE_SPU_API_H
#define SPU_DECODER_IFACE_VERSION 9
+/* FIXME: Needed for spu_button_t */
+/* But will not be on all users's systems. (From the libspudec directory or libdvdread). */
+#include <nav_types.h>
/*
* generic xine spu decoder plugin interface
@@ -50,6 +53,8 @@ struct spu_decoder_s {
void (*dispose) (spu_decoder_t *this);
+ int (*get_nav_pci) (spu_decoder_t *this, void *nav_pci);
+
};
typedef struct spu_button_s spu_button_t;
@@ -61,6 +66,7 @@ struct spu_button_s {
uint16_t top, bottom;
int64_t pts;
uint32_t buttonN;
+ pci_t nav_pci;
};
typedef struct spudec_clut_table_s spudec_clut_table_t;
diff --git a/src/libspudec/xine_decoder.c b/src/libspudec/xine_decoder.c
index 9ee27bf01..e62aab25f 100644
--- a/src/libspudec/xine_decoder.c
+++ b/src/libspudec/xine_decoder.c
@@ -19,7 +19,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.75 2002/09/05 22:18:58 mroi Exp $
+ * $Id: xine_decoder.c,v 1.76 2002/09/18 04:20:09 jcdutton Exp $
*
* stuff needed to turn libspu into a xine decoder plugin
*/
@@ -291,7 +291,24 @@ static void spudec_dispose (spu_decoder_t *this_gen) {
free (this->event.object.overlay);
free (this);
}
+/* gets the current already correctly processed nav_pci info */
+/* This is not perfectly in sync with the display, but all the same, */
+/* much closer than doing it at the input stage. */
+/* returns a bool for error/success.*/
+static int spudec_get_nav_pci (spu_decoder_t *this_gen, void *pci) {
+ spudec_decoder_t *this = (spudec_decoder_t *) this_gen;
+ pci_t *nav_pci = (pci_t *) pci;
+
+ if (!this || !nav_pci)
+ return 0;
+
+ pthread_mutex_lock(&this->nav_pci_lock);
+ memcpy(nav_pci, &this->pci, sizeof(pci_t) );
+ pthread_mutex_unlock(&this->nav_pci_lock);
+ return 1;
+}
+
static void *init_spu_decoder_plugin (xine_t *xine, void *data) {
spudec_decoder_t *this ;
@@ -304,6 +321,7 @@ static void *init_spu_decoder_plugin (xine_t *xine, void *data) {
this->spu_decoder.close = spudec_close;
this->spu_decoder.get_identifier = spudec_get_id;
this->spu_decoder.dispose = spudec_dispose;
+ this->spu_decoder.get_nav_pci = spudec_get_nav_pci;
this->xine = xine;