summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Roitzsch <mroi@users.sourceforge.net>2002-07-06 16:36:43 +0000
committerMichael Roitzsch <mroi@users.sourceforge.net>2002-07-06 16:36:43 +0000
commit1785298ed1de7923d678b9386e682d157be850d8 (patch)
tree26b97ca9b433ac2f48dbbccd0aa7736518b3a28b
parentbd39d799be9fcc823bf6a84aa62d022e058a3e9c (diff)
downloadxine-lib-1785298ed1de7923d678b9386e682d157be850d8.tar.gz
xine-lib-1785298ed1de7923d678b9386e682d157be850d8.tar.bz2
Button areas in the nav packets are in screen coordinated.
Overlay clipping areas are in overlay coordinates. Therefore, up to now, the menu highlight positions were only correct, when the menu subpicture started at (0,0) on screen. Although this seems to be common, it is not necessarily true and I have dvds here, for which it is not. The fix is easy: Correctly convert the button areas to clipping areas by subtracting the subpictures display offset. CVS patchset: 2221 CVS date: 2002/07/06 16:36:43
-rw-r--r--src/libspudec/spu.c22
-rw-r--r--src/libspudec/spu.h5
-rw-r--r--src/libspudec/xine_decoder.c5
3 files changed, 20 insertions, 12 deletions
diff --git a/src/libspudec/spu.c b/src/libspudec/spu.c
index ea4b65cfb..b381585c0 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.39 2002/04/24 20:26:07 jcdutton Exp $
+ * $Id: spu.c,v 1.40 2002/07/06 16:36:43 mroi Exp $
*
*/
@@ -70,7 +70,8 @@
void spudec_reassembly (spudec_seq_t *seq, uint8_t *pkt_data, u_int pkt_len);
void spudec_process( spudec_decoder_t *this, uint32_t stream_id);
void spudec_decode_nav( spudec_decoder_t *this, buf_element_t *buf);
-void spudec_copy_nav_to_overlay(pci_t* nav_pci, uint32_t* clut, int32_t button, int32_t mode, vo_overlay_t * overlay );
+void spudec_copy_nav_to_overlay(pci_t* nav_pci, uint32_t* clut, int32_t button, int32_t mode,
+ vo_overlay_t * overlay, vo_overlay_t * base );
static void spudec_do_commands (spudec_state_t *state, spudec_seq_t* seq, vo_overlay_t *ovl);
static void spudec_draw_picture (spudec_state_t *state, spudec_seq_t* seq, vo_overlay_t *ovl);
static void spudec_discover_clut (spudec_state_t *state, vo_overlay_t *ovl);
@@ -335,7 +336,8 @@ void spudec_process (spudec_decoder_t *this, uint32_t stream_id) {
#ifdef LOG_BUTTON
fprintf(stderr, "libspudec:Full Overlay\n");
#endif
- spudec_copy_nav_to_overlay(&this->pci, this->state.clut, this->buttonN, 0, &this->overlay );
+ spudec_copy_nav_to_overlay(&this->pci, this->state.clut, this->buttonN, 0, &this->overlay,
+ &this->overlay);
} else {
/* Subtitle and not a menu button */
int i;
@@ -824,7 +826,8 @@ static void spudec_print_overlay( vo_overlay_t *ovl ) {
ovl->clip_trans[0], ovl->clip_trans[1], ovl->clip_trans[2], ovl->clip_trans[3]);
return;
}
-void spudec_copy_nav_to_overlay(pci_t* nav_pci, uint32_t* clut, int32_t button, int32_t mode, vo_overlay_t * overlay ) {
+void spudec_copy_nav_to_overlay(pci_t* nav_pci, uint32_t* clut, int32_t button, int32_t mode,
+ vo_overlay_t * overlay, vo_overlay_t * base ) {
btni_t *button_ptr;
int i;
@@ -843,10 +846,13 @@ void spudec_copy_nav_to_overlay(pci_t* nav_pci, uint32_t* clut, int32_t button,
}
/* FIXME:Only the first grouping of buttons are used at the moment */
button_ptr = &nav_pci->hli.btnit[button-1];
- overlay->clip_left = button_ptr->x_start;
- overlay->clip_top = button_ptr->y_start;
- overlay->clip_right = button_ptr->x_end;
- overlay->clip_bottom = button_ptr->y_end;
+ /* button areas in the nav packet are in screen coordinates,
+ * overlay clipping areas are in overlay coordinates;
+ * therefore we must substract the display coordinates of the underlying overlay */
+ overlay->clip_left = (button_ptr->x_start > base->x) ? (button_ptr->x_start - base->x) : 0;
+ overlay->clip_top = (button_ptr->y_start > base->y) ? (button_ptr->y_start - base->y) : 0;
+ overlay->clip_right = (button_ptr->x_end > base->x) ? (button_ptr->x_end - base->x) : 0;
+ overlay->clip_bottom = (button_ptr->y_end > base->y) ? (button_ptr->y_end - base->y) : 0;
if(button_ptr->btn_coln != 0) {
#ifdef LOG_BUTTON
fprintf(stderr, "libspudec: normal button clut\n");
diff --git a/src/libspudec/spu.h b/src/libspudec/spu.h
index f85c16841..27329a30a 100644
--- a/src/libspudec/spu.h
+++ b/src/libspudec/spu.h
@@ -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: spu.h,v 1.14 2002/04/24 13:42:17 jcdutton Exp $
+ * $Id: spu.h,v 1.15 2002/07/06 16:36:43 mroi Exp $
*
* This file was originally part of the OMS program.
*
@@ -119,6 +119,7 @@ typedef struct spudec_decoder_s {
void spudec_reassembly (spudec_seq_t *seq, uint8_t *pkt_data, u_int pkt_len);
void spudec_process( spudec_decoder_t *this, uint32_t stream_id);
void spudec_decode_nav( spudec_decoder_t *this, buf_element_t *buf);
-void spudec_copy_nav_to_overlay(pci_t* nav_pci, uint32_t* clut, int32_t button, int32_t mode, vo_overlay_t * overlay );
+void spudec_copy_nav_to_overlay(pci_t* nav_pci, uint32_t* clut, int32_t button, int32_t mode,
+ vo_overlay_t * overlay, vo_overlay_t * base );
#endif
diff --git a/src/libspudec/xine_decoder.c b/src/libspudec/xine_decoder.c
index 3f2036ccb..dd3b5484c 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.70 2002/07/05 17:32:03 mroi Exp $
+ * $Id: xine_decoder.c,v 1.71 2002/07/06 16:36:43 mroi Exp $
*
* stuff needed to turn libspu into a xine decoder plugin
*/
@@ -247,7 +247,8 @@ static void spudec_event_listener(void *this_gen, xine_event_t *event_gen) {
#ifdef LOG_NAV
fprintf(stderr, "libspudec:Button Overlay\n");
#endif
- spudec_copy_nav_to_overlay(&this->pci, this->state.clut, this->buttonN, but->show-1, overlay );
+ spudec_copy_nav_to_overlay(&this->pci, this->state.clut, this->buttonN, but->show-1,
+ overlay, &this->overlay );
pthread_mutex_unlock(&this->nav_pci_lock);
} else {
fprintf (stderr,"libspudec:xine_decoder.c:spudec_event_listener:HIDE ????\n");