Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update audio track switch #2151

Conversation

nicosang
Copy link
Contributor

Hi,
as explained in the issue #1928, the audio track switch is broken for segmentTimeLine dash manifest. I think that it's unnecessary to destroy audio stream processor when an audio switch occurs. What dash.js player has to do is to restart scheduleController, load the new init segment and continue .... :-)

In order to this PR has to work properly, PR #2144 needs to be merged. I also would like to do more tests with dash streams with many audio tracks, if you have some.....thanks! ;-)

Nicolas

Copy link

@TobbeEdgeware TobbeEdgeware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change seems to fix the problem of switching audio language. At least for the test asset we have.

@TobbeEdgeware
Copy link

This looks like a real solution to the issue. I tested with the asset in #1928 and it works really well to switch audio language with this fix.

@epiclabsDASH
Copy link
Contributor

Sorry, I am testing this branch and I am seeing a weird behavior. As pointed out by @TobbeEdgeware, with the applied changes playback doesn't stop after switching audio tracks and it seems to work (with those "nice" beep!... beep!...).

However, if you take a look at segment requests, even after switching from track #1 to track #2, most of requests are done for segments that belong to the track #1. When switching from audio track #1 to audio track #2 I see just 1-2 requests for segments of track #2 and then, next ones are for segments of track #1.

Similar thing happen if you select audio track #2 and restart playback (to force playback to start with audio track #2).

I have checked that segment requests are working fine in latest version of Dash.js and in nightly builds (although not usable because playback is stalled).

So, at least I am missing something, I guess there is some pending work to do to really fix this.

I haven't taken a look myself to the code related with this yet but, intuitively, looking at how player behaves with dashjs 2.6 when there is an audio track switch and playback is stalled seems like a video/audio sync issue (timestamp alignment?). Just a thought, didn't have the time to verify that.

@nicosang
Copy link
Contributor Author

nicosang commented Sep 8, 2017

Hi,

you're right @epiclabsDASH , there is still some strange behaviors. I'm working on it. It would be interesting to have a Dash stream with SegmentTimeline and at least two real audio tracks with different codecs : is someone can provide it to me?

Thanks,
Nico

@nicosang
Copy link
Contributor Author

nicosang commented Sep 8, 2017

The problem is in validateExecutedFragmentRequest function of ScheduleController. if isCurrentTrack equals false (for instance when an audio track has changed) the last loaded request is added to replaceRequest Array. So, the request will be downloaded again for the new AdaptationSet without loading an init segment.
In order to solve this issue, I propose to remove this test (only the isCurrentTrack part) and load the new AdaptationSet after the good init segment..

@epiclabsDASH
Copy link
Contributor

Works perfect!

@epiclabsDASH epiclabsDASH merged commit 43b60a6 into Dash-Industry-Forum:development Sep 13, 2017
@nicosang nicosang deleted the audioTrackSwitchUpdate branch September 13, 2017 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants