summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphintuka <phintuka>2010-06-02 10:26:21 +0000
committerphintuka <phintuka>2010-06-02 10:26:21 +0000
commita1345b4b30d30654bfa358df88a8bbfbb9c8948a (patch)
tree6db90751e15707801cf74b7a069fb2b413df02ec
parent0f18cc3b9c2cd24c5602e5757a1532fe043a5a23 (diff)
downloadxineliboutput-a1345b4b30d30654bfa358df88a8bbfbb9c8948a.tar.gz
xineliboutput-a1345b4b30d30654bfa358df88a8bbfbb9c8948a.tar.bz2
ForcePrimaryDevice(): return true if switching is possible or we're currently the primary device
-rw-r--r--device.c7
-rw-r--r--device.h4
2 files changed, 7 insertions, 4 deletions
diff --git a/device.c b/device.c
index d6b99d11..7508672d 100644
--- a/device.c
+++ b/device.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: device.c,v 1.110 2010-06-02 10:19:18 phintuka Exp $
+ * $Id: device.c,v 1.111 2010-06-02 10:26:21 phintuka Exp $
*
*/
@@ -333,13 +333,16 @@ void cXinelibDevice::MakePrimaryDevice(bool On)
new cXinelibOsdProvider(this);
}
-void cXinelibDevice::ForcePrimaryDevice(bool On)
+bool cXinelibDevice::ForcePrimaryDevice(bool On)
{
TRACEF("cXinelibDevice::ForcePrimaryDevice");
m_MainThreadLock.Lock();
m_MainThreadFunctors.Add(CreateFunctor(this, &cXinelibDevice::ForcePrimaryDeviceImpl, On));
m_MainThreadLock.Unlock();
+
+ return xc.force_primary_device ||
+ (cDevice::PrimaryDevice() && this == cDevice::PrimaryDevice());
}
void cXinelibDevice::ForcePrimaryDeviceImpl(bool On)
diff --git a/device.h b/device.h
index 9c27171f..b4365d99 100644
--- a/device.h
+++ b/device.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: device.h,v 1.58 2010-03-15 12:50:29 phintuka Exp $
+ * $Id: device.h,v 1.59 2010-06-02 10:26:21 phintuka Exp $
*
*/
@@ -81,7 +81,7 @@ class cXinelibDevice : public cDevice
public:
virtual void MakePrimaryDevice(bool On);
- void ForcePrimaryDevice(bool On);
+ bool ForcePrimaryDevice(bool On);
// Device capabilities