Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 107922 - mplayerplug-in can use mplayer-bin
Summary: mplayerplug-in can use mplayer-bin
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Daniel Gryniewicz (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-02 12:48 UTC by Daniel Gryniewicz (RETIRED)
Modified: 2007-05-16 22:32 UTC (History)
8 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for mplayer-bin (mplayerplug-in-3.11-mplayer-bin.patch,530 bytes, patch)
2005-10-02 12:48 UTC, Daniel Gryniewicz (RETIRED)
Details | Diff
adds mplayer binary option (mplayerplug-in-mplayercfg.patch,2.71 KB, patch)
2006-01-07 13:20 UTC, Christian Birchinger (RETIRED)
Details | Diff
Updated mplayer binary config patch (mplayerplug-in-mplayercfg.patch,2.95 KB, patch)
2006-01-07 14:41 UTC, Christian Birchinger (RETIRED)
Details | Diff
Updated mplayerplug-in-3.31-r1.ebuild (mplayerplug-in-3.31-r1.ebuild,3.40 KB, application/octet-stream)
2006-09-23 06:57 UTC, Jonas Jonsson
Details
mplayer-bin.patch (mplayer-bin.patch,500 bytes, patch)
2006-09-23 06:58 UTC, Jonas Jonsson
Details | Diff
Version bump (mplayerplug-in-3.35.ebuild,3.43 KB, text/plain)
2006-12-20 04:04 UTC, Jonas Jonsson
Details
mplayerplug-in-3.40.ebuild (mplayerplug-in-3.40.ebuild,3.36 KB, text/plain)
2007-04-14 14:09 UTC, Jonas Jonsson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Gryniewicz (RETIRED) gentoo-dev 2005-10-02 12:48:17 UTC
mplayerplug-in can be used in 64-bit firefox/mozilla with 32-bit mplayer-bin. 
All that is required is a symlink of mplayer-bin to mplayer, plus a change to
the mplayerplug-in ebuild to not pull in mplayer.  This works because
mplayerplug-in execs mplayer, rather than loading it or any of it's libraries. 
The attached patch to mplayerplug-in-3.11.ebuild enables this (and moves the
mplayer dep to RDEPEND where it belongs)
Comment 1 Daniel Gryniewicz (RETIRED) gentoo-dev 2005-10-02 12:48:52 UTC
Created attachment 69745 [details, diff]
Patch for mplayer-bin
Comment 2 Joe Jezak (RETIRED) gentoo-dev 2005-10-11 20:13:43 UTC
Does mplayer-bin already have the symlink to mplayer.
Comment 3 Daniel Gryniewicz (RETIRED) gentoo-dev 2005-10-12 10:43:08 UTC
No, because mplayer could be installed either before or after.  If there's a
decent way to handle this, I'd love to do it.
Comment 4 Mario 2005-10-26 08:56:39 UTC
Why not have a use flag for mplayerplug-in that chooses to launch mplayer-bin
instead when emerged with this flag?
Comment 5 Daniel Gryniewicz (RETIRED) gentoo-dev 2005-10-29 12:15:41 UTC
That's quite possible.  I have a patch for mplayerplug-in that causes it to run
mplayer-bin rather than mplayer.  Would such an option be acceptible?
Comment 6 Luca Martini 2005-12-19 02:49:04 UTC
I think that also the firefox depencies can be fixed to avoid emerge mozilla if firefox-bin is present.
Comment 7 Pacho Ramos gentoo-dev 2005-12-30 05:37:36 UTC
I think that you can try to use mplayerplug-in-bin from http://www.sh.nu/download/ebuilds/mplayer/

Only needs an ebuild ;)
Comment 8 Christian Birchinger (RETIRED) gentoo-dev 2006-01-01 02:59:40 UTC
Wouldn't it be easier to ask the author for a config option for the name of the mplayer program? Then you can specify mplayer-executable=mplayer or mplayer-bin.
Comment 9 Henrik Johansson 2006-01-03 21:37:50 UTC
There's a similar problem with the image and movie viewer gimageview. Since there's no file called mplayer in $PATH you can't watch movies. One quick solution would be to create a symlink called mplayer pointing to mplayer-bin as mentioned before.

Another thing I have thought of is if there's any reason to have both mplayer and mplayer-bin installed at the same time? If not, I guess you could call /usr/bin/mplayer-bin mplayer as well and let the two packages block each other. This would make mplayer-bin compatible with other programs such as gimageview and mplayerplug-in.

I guess that gimageview could have mplayer or mplayer-bin as a dependancy just as in the patch posted earlier but that might be a separate bug report...
Comment 10 Christian Birchinger (RETIRED) gentoo-dev 2006-01-07 12:57:34 UTC
I tried to copy paste a few parts to get an additional mplayer= option in the config file. But since i have zero C++ knowledge i did something wrong. Maybe some one with some basic knowledge in C++ could do a quick patch.

plugin.h: I've added "char *mplayer_binary;"

plugin-setup.cpp: I've copied just another existing block to

if (strncasecmp(buffer, "mplayer", 7) == 0) {
    snprintf(parse, 1000, "%s", strtok(buffer, "="));
    snprintf(parse, 1000, "%s", strtok(NULL, "=\n"));
    if (instance->mplayer_binary != NULL)            
        free(instance->mplayer_binary);
    if (strstr(parse, "`") == NULL)     // don't allow shell commands
        instance->mplayer_binary = strdup(parse);                    
    continue;                                    
}

plugin-threads.cpp:
-      snprintf(buffer, 1024, "mplayer");
-      instance->td->argv[i++] = strdup(buffer);

+      if (instance->mplayer_binary) {
+          snprintf(buffer, 1024, "%s", instance->mplayer_binary);
+          instance->td->argv[i++] = strdup(buffer);
+      } else {
+          snprintf(buffer, 1024, "mplayer");
+          instance->td->argv[i++] = strdup(buffer);
+      }

Ofcourse i failed for some reason and it crashes.
Comment 11 Christian Birchinger (RETIRED) gentoo-dev 2006-01-07 13:20:42 UTC
Created attachment 76472 [details, diff]
adds mplayer binary option

I sucked hard and forgot to NULL the string. Theres a quick hack for 3.17.
Worked 2 mins. on my machine with either commented out mplayer= or something defined.
Comment 12 Christian Birchinger (RETIRED) gentoo-dev 2006-01-07 14:41:08 UTC
Created attachment 76487 [details, diff]
Updated mplayer binary config patch

Sigh one hopefully last NULLify (on shutdown)
Comment 13 Boky 2006-01-25 23:51:21 UTC
I have stumbeled across the same issue but with different package:
kmplayer.

I emerged "mplayer-bin" but now "kmplayer" wants to emerge mplayer.

I propose another solution: add the "symlink" flag to mplayer package.

If "symlink" is set, "mplayer-bin" is symlinked to "mplayer".

kmplayer and mplayerplugin could then check for (is this even possible?):

|| (mplayer mplayer-bin-with-symlink)
Comment 14 Kevin DeKorte 2006-02-14 07:00:04 UTC
Originally mplayerplug-in had an option just like this. It was removed because it allowed people to do dumb things... for example they could set mplayer-bin to something completely wrong

mplayer-bin=bash

A patch that does this will be rejected into mplayerplug-in
Comment 15 Christian Birchinger (RETIRED) gentoo-dev 2006-03-04 14:23:47 UTC
Great, punishing the average user because you want to protect some idiots from themselfs. 
Comment 16 Jonas Jonsson 2006-09-23 06:57:07 UTC
Created attachment 97846 [details]
Updated mplayerplug-in-3.31-r1.ebuild

Updated ebuild
* New useflag, mplayer-bin: Use mplayer-bin instead of mplayer.

* Change useflag realmedia to real.

* If amd64 it will also compile the 32bit plugins. This make mplayerplug-in work on both mozilla-firefox and mozilla-firefox-bin at the same time.

* Now depend on either mozilla-firefox or mozilla-firefox-bin

* Fixed bug #148625 mplayerplug-in: Install into /usr/lib[32,64]/nsbrowser/plugins instead?

* Need mplayer-bin.patch, see below.
Comment 17 Jonas Jonsson 2006-09-23 06:58:01 UTC
Created attachment 97848 [details, diff]
mplayer-bin.patch

Patch to change from mplayer to mplayer-bin.
Comment 18 Joe Jezak (RETIRED) gentoo-dev 2006-09-23 09:48:23 UTC
First of all, the realmedia flag should *not* be changed to real.  There are other ways to get real-media support besides using the real flag (which is masked on some arches). Since mplayerplug-in provides stream support, rather than the codec support, it needs to be different than "real".

I'll look into changing from installing to /opt, but I'm pretty sure that's like that for browsers that don't have /usr/lib[32,64]/nsbrowser/plugins as a plugin directory.  I guess we could add symlinks to /opt, but that defeats the purpose of moving it in the first place.

I have no AMD64 machine, so I can't comment on the AMD64 parts besides siding with Kevin since he's upstream.  If you can work out the mplayer-bin issues with Kevin and get them merged upstream, I'd be happy to fix mplayerplug-in's ebuild to support it.
Comment 19 Jonas Jonsson 2006-10-13 08:56:18 UTC
Sorry for the late reply, the email didn't reach me... *Sigh*

(In reply to comment #18)
> First of all, the realmedia flag should *not* be changed to real.  There are
> other ways to get real-media support besides using the real flag (which is
> masked on some arches). Since mplayerplug-in provides stream support, rather
> than the codec support, it needs to be different than "real".
Ok, didn't know that...

> 
> I'll look into changing from installing to /opt, but I'm pretty sure that's
> like that for browsers that don't have /usr/lib[32,64]/nsbrowser/plugins as a
> plugin directory.  I guess we could add symlinks to /opt, but that defeats the
> purpose of moving it in the first place.
Isn't there any way to change this behavior for the browsers in question, if there are any? Installing into /opt feels wrong when using a multilib system, works good on a none multilib system. Or is it just me?

If we choose to install into /usr/lib instead we wouldn't be the only application to do that, Totem for example install into /usr/lib. So I really don't see the problem here but it's possible that I'm blind.

> 
> I have no AMD64 machine, so I can't comment on the AMD64 parts besides siding
> with Kevin since he's upstream.  If you can work out the mplayer-bin issues
> with Kevin and get them merged upstream, I'd be happy to fix mplayerplug-in's
> ebuild to support it.
> 

I'm not sure if I follow you on this one, but by using the patch instead of an option for mplayerplug-in the problem never occurs, right? 

Is it a bad solution to install the plugin for 32-bit and 64-bit browsers?
Mplayerplug-in does in fact have a configure option for this purpose.

Comment 20 Jonas Jonsson 2006-12-20 04:04:06 UTC
Created attachment 104439 [details]
Version bump

Thought I'd version bump this ebuild. It works great for me on amd64 (nocona).
Comment 21 Ryan May 2007-01-23 14:27:44 UTC
Ebuild works great for me -- at least the building of the 32 bit plugin (which works great).  I'd like to voice my support for this ebuild (or some other option) building a 32-bit mplayerplug-in for amd64, since without it, no single browser can have the necessary plugins on amd64.
Comment 22 Jonas Jonsson 2007-04-14 14:09:13 UTC
Created attachment 116235 [details]
mplayerplug-in-3.40.ebuild

Version bump, you will need the patches from #172328
Comment 23 Joe Jezak (RETIRED) gentoo-dev 2007-05-16 22:32:43 UTC
I've added the mplayer-bin patch and moved to the nsplugin dir instead of opt.  I still won't change the realmedia flag as real is only for enabling the binary real codecs, not enabling real support in general.  The main problems that this bug brought up are now addressed, but feel free to open a new bug if you've got other changes.