xine-lib/xine-lib-crippled-LOCAL.diff

88 lines
3.3 KiB
Diff
Raw Normal View History

Index: src/input/input_dvd.c
===================================================================
--- src/input/input_dvd.c.orig
+++ src/input/input_dvd.c
@@ -1385,7 +1385,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
@@ -1401,7 +1406,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))
@@ -1409,6 +1413,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) {
@@ -1471,8 +1492,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, *locator_orig;
char *title_part;
@@ -1481,6 +1505,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_orig = locator = strdup (this->mrl + (sizeof("dvd:") - 1));