Skip to content

Commit

Permalink
qml: apply audioBackends property wang-bin#615
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed May 12, 2016
1 parent e616969 commit 329b8e0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions qml/QmlAVPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 250,10 @@ void QmlAVPlayer::setVideoCodecOptions(const QVariantMap &value)
return;
vcodec_opt = value;
Q_EMIT videoCodecOptionsChanged();
if (!mpPlayer) {
qWarning("player not ready");
return;
}
QVariantHash vcopt;
for (QVariantMap::const_iterator cit = vcodec_opt.cbegin(); cit != vcodec_opt.cend(); cit) {
vcopt[cit.key()] = cit.value();
Expand Down Expand Up @@ -629,6 633,9 @@ void QmlAVPlayer::setPlaybackState(PlaybackState playbackState)
mpPlayer->setOptionsForVideoCodec(vcopt);
}
m_loading = true;
mpPlayer->stop();
// change backends is not thread safe now, so change when stopped
mpPlayer->audio()->setBackends(m_ao);
mpPlayer->play();
}
break;
Expand Down
2 changes: 2 additions & 0 deletions qml/Video.qml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 65,8 @@ Item {
property alias videoFiltersGPU: videoOut.filters
property alias audioFilters: player.audioFilters
property alias videoFilters: player.videoFilters
property alias audioBackends: player.audioBackends
property alias supportedAudioBackends: player.supportedAudioBackends
property alias backgroundColor: videoOut.backgroundColor
property alias frameSize: videoOut.frameSize
property alias sourceAspectRatio: videoOut.sourceAspectRatio
Expand Down

0 comments on commit 329b8e0

Please sign in to comment.