summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--src/input/input_plugin.h2
-rw-r--r--src/xine-engine/xine.c21
3 files changed, 25 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index d7109650a..c873d9e26 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,8 @@ xine-lib (1.1.14) 2008-??-??
This is used for demuxer plugin selection immediately before testing the
filename extension (so it won't work when demuxer selection is done by
stream content only). [Bug #120]
+ * Allow input plugins to ask for a specific demuxer, overriding the normal
+ demuxer selection methods. (Most won't need this.)
xine-lib (1.1.13) 2008-06-15
* Security fixes:
diff --git a/src/input/input_plugin.h b/src/input/input_plugin.h
index ff4c75b29..080e05476 100644
--- a/src/input/input_plugin.h
+++ b/src/input/input_plugin.h
@@ -311,6 +311,8 @@ struct input_plugin_s {
#define INPUT_OPTIONAL_DATA_MIME_TYPE 8
/* buffer is unused; true if the demuxer should be determined by the MIME type */
#define INPUT_OPTIONAL_DATA_DEMUX_MIME_TYPE 9
+/* buffer is a const char **; the string is static or freed by the input plugin. */
+#define INPUT_OPTIONAL_DATA_DEMUXER 10
#define MAX_MRL_ENTRIES 255
#define MAX_PREVIEW_SIZE 4096
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c
index 984b6ade9..e4e36527f 100644
--- a/src/xine-engine/xine.c
+++ b/src/xine-engine/xine.c
@@ -1185,6 +1185,27 @@ static int open_internal (xine_stream_t *stream, const char *mrl) {
/* enable buffered input plugin (request optimizer) */
stream->input_plugin = _x_cache_plugin_get_instance(stream, 0);
+ /* Let the plugin request a specific demuxer (if the user hasn't).
+ * This overrides find-by-content & find-by-extension.
+ */
+ if (!stream->demux_plugin)
+ {
+ char *default_demux = NULL;
+ stream->input_plugin->get_optional_data (stream->input_plugin, &default_demux, INPUT_OPTIONAL_DATA_DEMUXER);
+ if (default_demux)
+ {
+ stream->demux_plugin = _x_find_demux_plugin_by_name (stream, default_demux, stream->input_plugin);
+ if (stream->demux_plugin)
+ {
+ lprintf ("demux and input plugin found\n");
+ _x_meta_info_set_utf8 (stream, XINE_META_INFO_SYSTEMLAYER,
+ stream->demux_plugin->demux_class->get_identifier (stream->demux_plugin->demux_class));
+ }
+ else
+ xine_log (stream->xine, XINE_LOG_MSG, _("xine: couldn't load plugin-specified demux %s for >%s<\n"), default_demux, mrl);
+ }
+ }
+
if (!stream->demux_plugin) {
/*