summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Caujolle-Bert <f1rmb@users.sourceforge.net>2002-03-25 22:55:42 +0000
committerDaniel Caujolle-Bert <f1rmb@users.sourceforge.net>2002-03-25 22:55:42 +0000
commit349ef0c7a04f7709f8abd64695269b6fb11f6038 (patch)
treee3a0697a45fed66160aebb2b245871d1999738bf
parent2ce20697979d3765779b59159d44b058d6af9b38 (diff)
downloadxine-lib-349ef0c7a04f7709f8abd64695269b6fb11f6038.tar.gz
xine-lib-349ef0c7a04f7709f8abd64695269b6fb11f6038.tar.bz2
Add ability to turn off sputexts.
CVS patchset: 1633 CVS date: 2002/03/25 22:55:42
-rw-r--r--src/input/input_file.c35
-rw-r--r--src/libsputext/xine_decoder.c8
2 files changed, 29 insertions, 14 deletions
diff --git a/src/input/input_file.c b/src/input/input_file.c
index 71de6bdb8..4eb9a7c9f 100644
--- a/src/input/input_file.c
+++ b/src/input/input_file.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: input_file.c,v 1.40 2002/03/16 20:53:50 guenter Exp $
+ * $Id: input_file.c,v 1.41 2002/03/25 22:55:42 f1rmb Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -266,7 +266,7 @@ static off_t get_file_size(char *filepathname, char *origin) {
*/
static uint32_t file_plugin_get_capabilities (input_plugin_t *this_gen) {
- return INPUT_CAP_SEEKABLE | INPUT_CAP_GET_DIR;
+ return INPUT_CAP_SEEKABLE | INPUT_CAP_GET_DIR | INPUT_CAP_SPULANG;
}
/*
@@ -806,17 +806,28 @@ static int file_plugin_get_optional_data (input_plugin_t *this_gen,
data_type, this->sub);
- if ( (data_type == INPUT_OPTIONAL_DATA_TEXTSPU0)
- && this->sub ) {
-
- FILE **tmp;
-
- /* dirty hacks... */
-
- tmp = data;
- *tmp = this->sub;
-
+ switch(data_type) {
+ case INPUT_OPTIONAL_DATA_TEXTSPU0:
+ if(this->sub) {
+ FILE **tmp;
+
+ /* dirty hacks... */
+ tmp = data;
+ *tmp = this->sub;
+
+ return INPUT_OPTIONAL_SUCCESS;
+ }
+ break;
+
+ case INPUT_OPTIONAL_DATA_SPULANG:
+ sprintf(data, "%3s", (this->sub) ? "on" : "off");
return INPUT_OPTIONAL_SUCCESS;
+ break;
+
+ default:
+ return INPUT_OPTIONAL_UNSUPPORTED;
+ break;
+
}
return INPUT_OPTIONAL_UNSUPPORTED;
diff --git a/src/libsputext/xine_decoder.c b/src/libsputext/xine_decoder.c
index 53a6d4d4b..9d9c5a19a 100644
--- a/src/libsputext/xine_decoder.c
+++ b/src/libsputext/xine_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: xine_decoder.c,v 1.17 2002/03/14 13:57:15 miguelfreitas Exp $
+ * $Id: xine_decoder.c,v 1.18 2002/03/25 22:55:42 f1rmb Exp $
*
* code based on mplayer module:
*
@@ -808,7 +808,7 @@ static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) {
this->renderer->set_position (this->osd, 0, y);
- this->renderer->render_text (this->osd, 0, 0, "sputext decoder", OSD_TEXT1);
+ /* this->renderer->render_text (this->osd, 0, 0, "sputext decoder", OSD_TEXT1); */
current_time = this->xine->metronom->get_current_time (this->xine->metronom);
this->renderer->show (this->osd, current_time);
@@ -830,6 +830,10 @@ static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) {
int frame_num;
subtitle_t *subtitle;
+ /* don't want to see subtitle */
+ if(this->xine->spu_channel_user == -2)
+ return;
+
subtitle = NULL;
pts = buf->pts;