summaryrefslogtreecommitdiff
path: root/debian/patches/01-add-mplayer2-detection.patch
blob: afb8d4a7ab69b4bca703ec431798a36d15c745d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Author: Reinhard Tartler <siretart@tauware.de>
Description: Detect that the binary is actually mplayer2
Bug-Debian: http://bugs.debian.org/699864

smplayer can handle mplayer2 if it detects its presence. Upstream's
solution to rename mplayer to mplayer2 is not acceptable for
Debian. Since executing the mplayer program to parse its version
identification output is too heavy-weight, this change introduces a
dpkg-specific, but light-weight check.

---
 src/core.cpp |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- smplayer.orig/src/core.cpp
+++ smplayer/src/core.cpp
@@ -28,6 +28,7 @@
 #endif
 
 #include <cmath>
+#include <unistd.h>
 
 #include "mplayerwindow.h"
 #include "desktopinfo.h"
@@ -1455,9 +1456,10 @@ void Core::startMplayer( QString file, d
         mplayer_bin = fi.absoluteFilePath();
 	}
 
-	if (fi.baseName().toLower() == "mplayer2") {
+	// debian/ubuntu specific check if we are using mplayer2
+	if ((fi.baseName().toLower() == "mplayer2") || !access("/usr/share/doc/mplayer2/copyright", F_OK)) {
+		qDebug("Core::startMplayer: this seems mplayer2");
 		if (!pref->mplayer_is_mplayer2) {
-			qDebug("Core::startMplayer: this seems mplayer2");
 			pref->mplayer_is_mplayer2 = true;
 		}
 	}