Package: phonon / 4:4.10.2-1

do_not_assume_existing_backend.patch Patch series | download
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
38
39
40
41
42
43
44
45
46
47
From: Debian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Date: Sat, 14 May 2016 18:53:56 +0200
Subject: do_not_assume_existing_backend

commit ec5f8fc79338e15b69d24fd89b9fccf93049624f
Author: Harald Sitter <sitter@kde.org>
Date:   Wed Nov 26 23:28:06 2014 +0100

    do not assume we have a backend when setting an output device
    
    random suggestion du jour: since debianesque distros are the only ones
    allowing running without a backend (to my knowledge anyway), this fix
    should be adopted there at the earliest convenient time.
    
    this change prevents a crash when run without a backend and getting device
    changes as the Iface handling later on would directly call the cast output
    without checking its validity. since the cast would always be null when
    there is no backend we can just as well save time and return early.
    
    note: this is ultimately fallout from too excessive init() setup
    when there is no backend, so the ideal fix would have been to abort the
    setup there. given the limited testing exposure of alsa+phononserver+phonon
    this less invasive fix is deemed more suitable for the existing code base
    though.
    (this lineup only happens with phononserver in the picture and that
     bugger has already been killed off for plasma5)
    
    BUG: 341296
    CCMAIL: pkg-kde-talk@lists.alioth.debian.org
---
 phonon/audiooutput.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/phonon/audiooutput.cpp b/phonon/audiooutput.cpp
index 85d0836..f1b1898 100644
--- a/phonon/audiooutput.cpp
+++ b/phonon/audiooutput.cpp
@@ -58,6 +58,9 @@ static inline bool callSetOutputDevice(AudioOutputPrivate *const d, const AudioO
     if (!d->backendObject())
         return false;
 
+    if (!d->backendObject())
+        return false;
+
     Iface<IFACES2> iface(d);
     if (iface) {
         return iface->setOutputDevice(dev);