Skip to content

Commit

Permalink
player: fix audio tracks menu number
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Oct 9, 2013
1 parent 15c1c29 commit 4ee5769
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/player/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -715,10 +715,10 @@ void MainWindow::openUrl()
void MainWindow::initAudioTrackMenu()
{
int track = mpPlayer->currentAudioStream();
if (mpAudioTrackAction && mpAudioTrackAction->data().toInt() == track)
return;
QList<QAction*> as = mpAudioTrackMenu->actions();
int tracks = mpPlayer->audioStreamCount();
if (mpAudioTrackAction && tracks == as.size() && mpAudioTrackAction->data().toInt() == track)
return;
while (tracks < as.size()) {
QAction *a = as.takeLast();
mpAudioTrackMenu->removeAction(a);
Expand Down

0 comments on commit 4ee5769

Please sign in to comment.