xine-lib/xine-lib-crippled-LOCAL.diff
OBS User autobuild 7f0ad371b5 Accepting request 30112 from multimedia:xine
Copy from multimedia:xine/xine-lib based on submit request 30112 from user lnussel

OBS-URL: https://build.opensuse.org/request/show/30112
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/xine-lib?expand=0&rev=28
2010-01-21 10:30:03 +00:00

88 lines
3.1 KiB
Diff

Index: src/input/input_dvd.c
===================================================================
--- src/input/input_dvd.c.orig
+++ src/input/input_dvd.c
@@ -1387,7 +1387,12 @@
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
@@ -1403,7 +1408,6 @@
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))
@@ -1411,6 +1415,23 @@
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) {
@@ -1473,8 +1494,11 @@
}
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;
@@ -1483,6 +1507,23 @@
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));