Search
j0ke.net Open Build Service
>
Projects
>
multimedia
:
SL11
>
xine-lib
> xine-lib-crippled-LOCAL.diff
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File xine-lib-crippled-LOCAL.diff of Package xine-lib
Index: src/input/input_dvd.c =================================================================== --- src/input/input_dvd.c.orig +++ src/input/input_dvd.c @@ -1393,7 +1393,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 @@ -1409,7 +1414,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)) @@ -1417,6 +1421,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) { @@ -1479,8 +1500,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; @@ -1489,6 +1513,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));