Bug 280681 - incorrect audio channel indexing
Summary: incorrect audio channel indexing
Status: RESOLVED FIXED
Alias: None
Product: phonon-backend-vlc
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 0.4-git
Platform: Unlisted Binaries Linux
: NOR normal
Target Milestone: 0.4.2
Assignee: Harald Sitter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-24 03:20 UTC by siyuan cao
Modified: 2011-08-29 10:06 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 0.5
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description siyuan cao 2011-08-24 03:20:29 UTC
Version:           0.4-git (using KDE 4.7.0) 
OS:                Linux

MediaController::refreshAudioChannels() stores audio tracks and corresponding indices retrieved from p_info->i_id which might be -1 (which indicates disabling audio). then MediaController::setCurrentAudioChannel() calls libvlc_audio_set_track to switch audio track with this index which is invalid, the consequence is that disabling audio is failed.

Reproducible: Always

Steps to Reproduce:
just play a video and change audio channel. I use loopy to test (actually my fork: https://github.com/sonald/loopy) and dragon will also do.

Actual Results:  
disabling audio failed

Expected Results:  
disabling audio successes
Comment 1 Harald Sitter 2011-08-24 08:58:07 UTC
Related review request: https://git.reviewboard.kde.org/r/102298/

Might be broken by the same way https://projects.kde.org/projects/kdesupport/phonon/phonon-vlc/repository/revisions/master/entry/src/mediacontroller.cpp#L322 is broken.

Are you sure that your approach works for all sorts of audio channel enumerations (MKVs with audio, DVDs ...)?
Comment 2 siyuan cao 2011-08-25 07:15:48 UTC
I can't say 100% sure when I have only checked some .mov, .mp4, .mkv files.
however I've looked into vlc source code, and libvlc_audio_set_track( libvlc_media_player_t *p_mi, int i_track ) proves that libvlc use simply array index for track.
ref: http://git.videolan.org/?p=vlc.git;a=blob;f=src/control/audio.c;h=c7d1ba125f0cd12e5c2061e341e1e336f1a3022d;hb=HEAD
Comment 3 Harald Sitter 2011-08-25 21:16:54 UTC
This should be fixed in git master now.
I added it to the a major refactoring I did over the past days.
Comment 4 Harald Sitter 2011-08-29 10:06:52 UTC
Git commit 50f820c19c4986fe723a1c5f9be28cfd135d9154 by Harald Sitter.
Committed on 29/08/2011 at 12:06.
Pushed by sitter into branch 'master'.

Fix refreshAudioChannels

No idea how that slipped the refactor.

REVIEW: 102298
BUG: 280681
FIXED-IN: 0.5

M  +5    -1    src/mediacontroller.cpp

http://commits.kde.org/phonon-vlc/50f820c19c4986fe723a1c5f9be28cfd135d9154