SHA256
1
0
forked from pool/xine-lib
xine-lib/xine-lib-crippled-LOCAL.diff

87 lines
3.3 KiB
Diff
Raw Normal View History

diff -urp ../xine-lib-1.1.2.orig/src/input/input_dvd.c ./src/input/input_dvd.c
--- ../xine-lib-1.1.2.orig/src/input/input_dvd.c 2006-07-09 16:37:35.000000000 +0200
+++ ./src/input/input_dvd.c 2006-10-11 14:19:43.000000000 +0200
@@ -1391,7 +1391,12 @@ check_solaris_vold_device(dvd_input_clas
static int dvd_parse_try_open(dvd_input_plugin_t *this, const char *locator)
{
- const char *intended_dvd_device;
+ const char *intended_dvd_device;
+ dvd_input_class_t *class = (dvd_input_class_t *)
+ this->input_plugin.input_class;
+ xine_sarray_t **plgs = class->xine->plugin_catalog->plugin_lists;
+ plugin_node_t *node;
+ int i;
/* FIXME: we temporarily special-case "dvd:/" for compatibility;
* actually "dvd:/" should play a DVD image stored in /, but for
@@ -1407,7 +1412,6 @@ static int dvd_parse_try_open(dvd_input_
xine_setenv("DVDCSS_RAW_DEVICE", "", 1);
} else {
/* use default DVD device */
- dvd_input_class_t *class = (dvd_input_class_t*)this->input_plugin.input_class;
xine_cfg_entry_t raw_device;
if (xine_config_lookup_entry(this->stream->xine,
"media.dvd.raw_device", &raw_device))
@@ -1415,6 +1419,23 @@ static int dvd_parse_try_open(dvd_input_
intended_dvd_device = class->dvd_device;
}
+ for (i = 0; (node = xine_sarray_get (plgs[PLUGIN_VIDEO_DECODER-1], i)); i++)
+ if (strcmp (node->info->id, "mpeg2") == 0)
+ break;
+ if (node)
+ for (i = 0; (node = xine_sarray_get (plgs[PLUGIN_SPU_DECODER-1], i)); i++)
+ if (strcmp (node->info->id, "spudec") == 0)
+ break;
+ if (! node) {
+ _x_message (this->stream, XINE_MSG_GENERAL_WARNING,
+ "This version of Xine lacks support for playing DVD discs "
+ "for legal reasons.\n"
+ "Please go to http://www.opensuse.org/XINE#Legal_Matters "
+ "for further details.",
+ NULL);
+ return 0;
+ }
+
/* attempt to open DVD */
if (this->opened) {
if (intended_dvd_device == this->current_dvd_device) {
@@ -1477,8 +1498,11 @@ static int dvd_parse_mrl(dvd_input_plugi
}
static int dvd_plugin_open (input_plugin_t *this_gen) {
- dvd_input_plugin_t *this = (dvd_input_plugin_t*)this_gen;
+ dvd_input_plugin_t *this = (dvd_input_plugin_t*)this_gen;
dvd_input_class_t *class = (dvd_input_class_t*)this_gen->input_class;
+ xine_sarray_t **plgs = class->xine->plugin_catalog->plugin_lists;
+ plugin_node_t *node;
+ int i;
char *locator;
char *title_part;
@@ -1487,6 +1511,23 @@ static int dvd_plugin_open (input_plugin
trace_print("Called\n");
+ for (i = 0; (node = xine_sarray_get (plgs[PLUGIN_VIDEO_DECODER-1], i)); i++)
+ if (strcmp (node->info->id, "mpeg2") == 0)
+ break;
+ if (node)
+ for (i = 0; (node = xine_sarray_get (plgs[PLUGIN_SPU_DECODER-1], i)); i++)
+ if (strcmp (node->info->id, "spudec") == 0)
+ break;
+ if (! node) {
+ _x_message (this->stream, XINE_MSG_GENERAL_WARNING,
+ "This version of Xine lacks support for playing DVD discs "
+ "for legal reasons.\n"
+ "Please go to http://www.opensuse.org/XINE#Legal_Matters "
+ "for further details.",
+ NULL);
+ return 0;
+ }
+
/* we already checked the "dvd:/" MRL before */
locator = this->mrl + (sizeof("dvd:") - 1);