kaltura / nginx-vod-module

NGINX-based MP4 Repackager
GNU Affero General Public License v3.0
1.96k stars 431 forks source link

Make HLS first audio track AUTOSELECT=NO #1531

Open stereoshoots opened 6 days ago

stereoshoots commented 6 days ago

Hi.

iOS and tvOS native players incorrectly handle the situation where there are two tracks in the same language (for example: regular and 5.1 sound). I'm looking for a way to remove the default track from the manifest to solve this problem.

I've found this in m3u8_builder.c:

is_default = tracks[media_type]->media_info.tags.is_default;
if (is_default < 0)
{
    is_default = adaptation_set == first_adaptation_set;
}

if (is_default)
{
    p = vod_copy(p, M3U8_EXT_MEDIA_DEFAULT, sizeof(M3U8_EXT_MEDIA_DEFAULT) - 1);
}
else
{
    p = vod_copy(p, M3U8_EXT_MEDIA_NON_DEFAULT, sizeof(M3U8_EXT_MEDIA_NON_DEFAULT) - 1);
}

Where does media_info.tags.is_default comes from and how do i set it?

erankor commented 2 days ago

it comes from the default field on the sequence object in the mapping JSON - https://github.com/kaltura/nginx-vod-module/?tab=readme-ov-file#sequence