summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2006-09-07 15:11:19 +0000
committerBastien Nocera <hadess@src.gnome.org>2006-09-07 15:11:19 +0000
commitec3737a84886ac2c302452afd08bdfdc3a1f558c (patch)
tree0846e426f13928209df0279a4fbd10299a1aeccf
parentc31c2e5afeeae1140d4e756be7831aa278e61571 (diff)
downloadtotem-ec3737a84886ac2c302452afd08bdfdc3a1f558c.tar.gz
speed-up the parameter parsing a tad bit, implement support for
2006-09-07 Bastien Nocera <hadess@hadess.net> * browser-plugin/totemPlugin.cpp: speed-up the parameter parsing a tad bit, implement support for "showcontrols=false" (Closes: #354725)
-rw-r--r--ChangeLog6
-rw-r--r--browser-plugin/totemPlugin.cpp49
2 files changed, 26 insertions, 29 deletions
diff --git a/ChangeLog b/ChangeLog
index 9c97cdd55..023d7dc64 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2006-09-07 Bastien Nocera <hadess@hadess.net>
+ * browser-plugin/totemPlugin.cpp: speed-up the parameter parsing
+ a tad bit, implement support for "showcontrols=false"
+ (Closes: #354725)
+
+2006-09-07 Bastien Nocera <hadess@hadess.net>
+
* browser-plugin/totemPlugin.cpp: fix logic in using fd://0 (we
never have a local file when we haven't got a playlist), only
open a file descriptor if the viewer will be using fd://0
diff --git a/browser-plugin/totemPlugin.cpp b/browser-plugin/totemPlugin.cpp
index c2e6f71c3..210dda830 100644
--- a/browser-plugin/totemPlugin.cpp
+++ b/browser-plugin/totemPlugin.cpp
@@ -472,59 +472,52 @@ totem_plugin_new_instance (NPMIMEType mimetype,
printf ("argv[%d] %s %s\n", i, argn[i], argv[i]);
if (g_ascii_strcasecmp (argn[i],"width") == 0) {
plugin->width = strtol (argv[i], NULL, 0);
- }
- if (g_ascii_strcasecmp (argn[i], "height") == 0) {
+ } else if (g_ascii_strcasecmp (argn[i], "height") == 0) {
plugin->height = strtol (argv[i], NULL, 0);
- }
- if (g_ascii_strcasecmp (argn[i], "src") == 0) {
+ } else if (g_ascii_strcasecmp (argn[i], "src") == 0) {
plugin->src = resolve_relative_uri (docURI, argv[i]);
//plugin->srcSupported = is_supported_scheme (plugin->src);
- }
- /* Windows Media Player parameter */
- if (g_ascii_strcasecmp (argn[i], "filename") == 0) {
+ } else if (g_ascii_strcasecmp (argn[i], "filename") == 0) {
+ /* Windows Media Player parameter */
if (plugin->src == NULL) {
plugin->src = resolve_relative_uri (docURI, argv[i]);
g_message ("plugin->src = %s", plugin->src);
}
- }
- if (g_ascii_strcasecmp (argn[i], "href") == 0) {
+ } else if (g_ascii_strcasecmp (argn[i], "href") == 0) {
plugin->href = resolve_relative_uri (docURI, argv[i]);
- }
- if (g_ascii_strcasecmp (argn[i], "cache") == 0) {
+ } else if (g_ascii_strcasecmp (argn[i], "cache") == 0) {
plugin->cache = TRUE;
if (g_ascii_strcasecmp (argv[i], "false") == 0) {
plugin->cache = FALSE;
}
- }
- if (g_ascii_strcasecmp (argn[i], "target") == 0) {
+ } else if (g_ascii_strcasecmp (argn[i], "target") == 0) {
plugin->target = g_strdup (argv[i]);
- }
- /* Quicktime parameter */
- if (g_ascii_strcasecmp (argn[i], "controller") == 0) {
+ } else if (g_ascii_strcasecmp (argn[i], "controller") == 0) {
+ /* Quicktime parameter */
if (g_ascii_strcasecmp (argv[i], "false") == 0) {
plugin->controller_hidden = TRUE;
}
//FIXME see http://www.htmlcodetutorial.com/embeddedobjects/_EMBED_CONTROLS.html
- }
- /* Windows Media Player parameter */
- if (g_ascii_strcasecmp (argn[i], "uimode") == 0) {
+ } else if (g_ascii_strcasecmp (argn[i], "uimode") == 0) {
+ /* Windows Media Player parameter */
if (g_ascii_strcasecmp (argv[i], "none") == 0) {
plugin->controller_hidden = TRUE;
}
- }
- if (g_ascii_strcasecmp (argn[i], "hidden") == 0) {
+ } else if (g_ascii_strcasecmp (argn[i], "showcontrols") == 0) {
+ if (g_ascii_strcasecmp (argv[i], "false") == 0) {
+ plugin->controller_hidden = TRUE;
+ }
+ } else if (g_ascii_strcasecmp (argn[i], "hidden") == 0) {
if (g_ascii_strcasecmp (argv[i], "false") != 0) {
plugin->hidden = TRUE;
}
- }
- if (g_ascii_strcasecmp (argn[i], "autostart") == 0
+ } else if (g_ascii_strcasecmp (argn[i], "autostart") == 0
|| g_ascii_strcasecmp (argn[i], "autoplay") == 0) {
if (g_ascii_strcasecmp (argv[i], "false") == 0
|| g_ascii_strcasecmp (argv[i], "0") == 0) {
plugin->noautostart = TRUE;
}
- }
- if (g_ascii_strcasecmp (argn[i], "loop") == 0
+ } else if (g_ascii_strcasecmp (argn[i], "loop") == 0
|| g_ascii_strcasecmp (argn[i], "repeat") == 0) {
if (g_ascii_strcasecmp (argv[i], "true") == 0) {
plugin->repeat = TRUE;
@@ -532,11 +525,9 @@ totem_plugin_new_instance (NPMIMEType mimetype,
// FIXME Doesn't handle playcount, or loop with numbers
// http://www.htmlcodetutorial.com/embeddedobjects/_EMBED_LOOP.html
- }
- if (g_ascii_strcasecmp (argn[i], "starttime") == 0) {
+ } else if (g_ascii_strcasecmp (argn[i], "starttime") == 0) {
//FIXME see http://www.htmlcodetutorial.com/embeddedobjects/_EMBED_STARTTIME.html
- }
- if (g_ascii_strcasecmp (argn[i], "endtime") == 0) {
+ } else if (g_ascii_strcasecmp (argn[i], "endtime") == 0) {
//FIXME see above
}
}