Opened 14 years ago
Closed 14 years ago
#7638 closed defect (fixed)
DVD: wrong audio track selected when switching
Reported by: | Owned by: | skamithi | |
---|---|---|---|
Priority: | minor | Milestone: | unknown |
Component: | MythTV - General | Version: | unknown |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
Hi,
when the logical order of audio streams on a DVD and the order of their stream ids do not match, the internal player will select the wrong audio streams for selections in the OSD 'Select Audio Track' menu or the DVD menu.
I traced this to the sorting of audio streams in 'AvFormatDecoder::ScanStreams?' and simply removing the sorting solved my problem. However, I am not sure whether the sorting is actually needed in other places, so in that case I think the logical trackNo should be added to the 'StreamInfo?' object to allow proper mapping.
I attached a patch that simply removes the sorting of the audio tracks that works for me. It is against release-0-22-fixes.
Please let me know if you need further info or testing.
Best wishes,
Martin.
Attachments (7)
Change History (15)
Changed 14 years ago by
Attachment: | dvdaudioordering.patch added |
---|
comment:1 Changed 14 years ago by
Owner: | changed from Isaac Richards to skamithi |
---|---|
Status: | new → assigned |
comment:2 Changed 14 years ago by
comment:3 Changed 14 years ago by
Hi,
I did some further testing and realized that the patch I initially provided is not correct. I now also understand why the sorting of the audio track list is necessary. However, the problem with the implementation was that it was sorting based on the physical audio stream ids and not the logical ones. The logical stream ids differ from the physical ones as those are offset depending of the stream encoding.
I am attaching a new patch against the current trunk (r22950) which sorts the audio streams according to their logical ids. This fixes all my (known) outstanding language sorting problems for me.
Best wishes,
Martin.
Changed 14 years ago by
Attachment: | dvd-audio-stream-ordering.dpatch added |
---|
patch to sort dvd audio stream according to their logical ids
Changed 14 years ago by
Attachment: | dvd-audio-stream-ordering-v2.patch added |
---|
comment:4 Changed 14 years ago by
Status: | assigned → accepted |
---|
can you use the patch i've attached as the basis for your fix. i'd like to keep dvdnav code out of avformatdecoder. patch is untested. your bug is a direct relation of [19956] which broke the sorting of dvd audio tracks.
comment:5 Changed 14 years ago by
Latest dvd-audio-stream-ordering-v2.patch seems to work fine and fixes the wrong audio track problem.
comment:6 Changed 14 years ago by
Hi,
dvd-audio-stream-ordering-v2.patch does not work for me, namely because dvdnav_get_audio_logical_stream does not work as expected. If you feed it the stream id the output will always be -1 (from looking at the code I guess it only maps some internal numbers as the input stream id must be <= 8 to get anything besides -1). So in fact your patch will behave exactly as before my original patch as dvd_track_num will always be set to -1.
In my second patch (dvd-audio-stream-ordering.dpatch) I have actually put the functionality that one thinks dvdnav_get_audio_logical_stream provides in the function dvd_get_logical_audio_stream_id. It will map the stream ids to their logical track nos (the disc I am always having problems with has a mix of AC3 and DTS tracks and the problem is that the AC3 tracks have a stream id range between 128 and 135 while DTS tracks start a 136; so in my example, the second logical track has stream id 137 which used to be put at the end of the track map by simple sorting).
I personally think that providing the dvd-specific comparator for the sorting a simpler solution now as it keeps irrelevant dvd-specific stuff out of StreamInfo? and its operator which seems to be a more generic structure. The sorting only happens in the DVD case anyway so having a DVD specific comparator should not be a problem.
As a sidenote, I was also wondering of whether the helper functions I added belong into avformatdecoder.cpp or DVDRingbuffer.h and it should be no problem to move them there.
Best wishes,
Martin.
Changed 14 years ago by
Attachment: | dvd-audio-stream-ordering-v3.patch added |
---|
use logical stream id in streaminfo for audio tracks. not sure if this will break anything. then my proposal is to go into dvdnav and fix its physical -> logical conversion code.
Changed 14 years ago by
Attachment: | dvd-audio-stream-ordering-v4.patch added |
---|
patch from martin kittel. substitute logical stream id for physical in streaminfo. may need to push the OFFSET code into dvdnav instead of leaving it in dvdringbuf
Changed 14 years ago by
Attachment: | dvd-audio-stream-ordering-v5.patch added |
---|
move stream_id checking from dvdringbuf to dvdnav code.
Changed 14 years ago by
Attachment: | dvd-audio-stream-ordering-v6.patch added |
---|
corrected oversight in patch version 5: one more instance of audioN had to be replaced by stream_id in vm_get_audio_stream
patch to remove sorting of audio streams by stream id