summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Courtier-Dutton <jcdutton@users.sourceforge.net>2001-10-20 20:13:08 +0000
committerJames Courtier-Dutton <jcdutton@users.sourceforge.net>2001-10-20 20:13:08 +0000
commit058e3bd311b75c2a380780dac16abd712c92e2a6 (patch)
treedad4da6fd73e83f5d82ef5168e06294bd05cf701
parentc82adbfa283fb2d7c18987857972e19902e44070 (diff)
downloadxine-lib-058e3bd311b75c2a380780dac16abd712c92e2a6.tar.gz
xine-lib-058e3bd311b75c2a380780dac16abd712c92e2a6.tar.bz2
Decide which stream to use in libspudec instead of video_decoder.c
Add support for hiding menus. CVS patchset: 843 CVS date: 2001/10/20 20:13:08
-rw-r--r--src/libspudec/xine_decoder.c29
-rw-r--r--src/xine-engine/video_decoder.c6
2 files changed, 26 insertions, 9 deletions
diff --git a/src/libspudec/xine_decoder.c b/src/libspudec/xine_decoder.c
index 5e85f89a0..e2b49d174 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.17 2001/10/20 17:51:59 jcdutton Exp $
+ * $Id: xine_decoder.c,v 1.18 2001/10/20 20:13:08 jcdutton Exp $
*
* stuff needed to turn libspu into a xine decoder plugin
*/
@@ -87,10 +87,11 @@ static clut_t __default_clut[] = {
#define EVENT_NULL 0
#define EVENT_SHOW_SPU 1
#define EVENT_HIDE_SPU 2
-#define EVENT_MENU_SPU 3
-#define EVENT_MENU_BUTTON 4
-#define EVENT_DELETE_RESOURCE 5 /* Maybe release handle will do this */
-#define EVENT_SHOW_OSD 6 /* Not yet implemented */
+#define EVENT_HIDE_MENU 3
+#define EVENT_MENU_SPU 4
+#define EVENT_MENU_BUTTON 5
+#define EVENT_DELETE_RESOURCE 6 /* Maybe release handle will do this */
+#define EVENT_SHOW_OSD 7 /* Not yet implemented */
typedef struct spu_object_s {
int32_t handle; /* Used to match Show and Hide events. */
@@ -354,6 +355,11 @@ void spu_process (spudec_decoder_t *this, uint32_t stream_id) {
* For subtitles, open event.
* For menus, store it for later.
*/
+ if (this->xine->spu_channel != stream_id) {
+ LOG (LOG_DEBUG, "Wrong SPU channel\n");
+ spu_free_handle(this, handle);
+ return;
+ }
if ((this->state.modified) ) {
spu_draw_picture(&this->state, this->cur_seq, &this->overlay);
}
@@ -376,7 +382,7 @@ void spu_process (spudec_decoder_t *this, uint32_t stream_id) {
this->event.object.handle = spu_get_menu_handle(this);
this->event.object.overlay = &this->overlay;
this->event.event_type = EVENT_MENU_SPU;
- this->event.vpts = 0; /* Activate it NOW */
+ this->event.vpts = this->spu_stream_state[stream_id].vpts+(this->state.delay*1000);
}
spu_add_event(this, &this->event);
} else {
@@ -498,6 +504,12 @@ void spu_process_event( spudec_decoder_t *this, int vpts ) {
spu_free_handle( this, handle );
break;
+ case EVENT_HIDE_MENU:
+ LOG (LOG_DEBUG, "HIDE MENU NOW\n");
+ this->spu_showing[1].handle = -1;
+ //spu_free_handle( this, handle );
+ break;
+
case EVENT_MENU_SPU:
LOG (LOG_DEBUG, "MENU SPU NOW\n");
if (this->spu_events[this_event].event->object.overlay != NULL) {
@@ -665,6 +677,11 @@ static void spudec_event_listener(void *this_gen, xine_event_t *event_gen) {
overlay->trans[3] = but->trans[3];
}
spu_add_event(this, overlay_event);
+ } else {
+ overlay_event->object.handle = spu_get_menu_handle(this);
+ overlay_event->event_type = EVENT_HIDE_MENU;
+ overlay_event->vpts = 0; /* Activate it NOW */
+ spu_add_event(this, overlay_event);
}
}
break;
diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c
index 182594930..ad06a7bda 100644
--- a/src/xine-engine/video_decoder.c
+++ b/src/xine-engine/video_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: video_decoder.c,v 1.57 2001/10/20 02:01:51 guenter Exp $
+ * $Id: video_decoder.c,v 1.58 2001/10/20 20:13:08 jcdutton Exp $
*
*/
@@ -120,14 +120,14 @@ void *video_decoder_loop (void *this_gen) {
profiler_start_count (prof_spu_decode);
/* now, decode this buffer if it's the right track */
- if ( (buf->type & 0xFFFF)== this->spu_channel) {
+// if ( (buf->type & 0xFFFF)== this->spu_channel) {
spu_decoder = update_spu_decoder (this, buf->type);
if (spu_decoder)
spu_decoder->decode_data (spu_decoder, buf);
- }
+// }
profiler_stop_count (prof_spu_decode);
break;