Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.5.3, 6.6.3, 6.7.1
-
None
-
-
cf092077e (dev), afd504142 (6.8), 53215b6d0 (6.7), 048a7e3eb (tqtc/lts-6.5)
-
Multimedia Next
Description
MediaPlayer does not take into account the selected audio output device if it was set immediately before playback started.
Can be reproduced with "darwin" multimedia backend.
Sample code:
import QtQuick import QtQuick.Controls import QtQuick.Layouts import QtMultimedia Window { width: 640 height: 480 visible: true RowLayout { ComboBox { id: devicesList Layout.preferredWidth: 200 textRole: "text" valueRole: "value" model: { const defaultDevice = devices.defaultAudioOutput let deviceNames = [{text: 'Default (%1)'.arg(defaultDevice.description), value: defaultDevice}] for (let device of devices.audioOutputs) deviceNames.push({text: device.description, value: device}) return deviceNames } } Button { text: playerLoader.active ? 'Stop' : 'Play' onClicked: playerLoader.active = !playerLoader.active } CheckBox { id: inLoop text: 'loop?' } } MediaDevices { id: devices } Loader { id: playerLoader active: false sourceComponent: MediaPlayer { id: player audioOutput: AudioOutput { device: devicesList.currentValue onDeviceChanged: console.log('Selected device:' + device) } autoPlay: true loops: inLoop.checked ? MediaPlayer.Infinite : 1 source: 'nokia-tune.mp3' } } }
See full example audio_output.zip
Steps to reproduce:
1. Plug-in any headphones (I tried wired ones) to your Mac Book
2. Run sample program
3. Select an output device which is not currently default in the system
4. Press "Play" button and check which device is playing audio
Actual results: sound is always playing through the default audio output
Expected results: sound is playing through the selected audio output
Attachments
For Gerrit Dashboard: QTBUG-126203 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
567682,6 | AVFMediaPlayer: set the initial audio output device on new player | dev | qt/qtmultimedia | Status: MERGED | +2 | 0 |
568126,2 | AVFMediaPlayer: set the initial audio output device on new player | 6.8 | qt/qtmultimedia | Status: MERGED | +2 | 0 |
568138,2 | AVFMediaPlayer: set the initial audio output device on new player | 6.7 | qt/qtmultimedia | Status: MERGED | +2 | 0 |
568206,2 | AVFMediaPlayer: set the initial audio output device on new player | tqtc/lts-6.5 | qt/tqtc-qtmultimedia | Status: MERGED | +2 | 0 |