From 90603e1a73e5f2ad25aa5f79cccb3ccce4fef2cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20H=C3=BCgli?= Date: Thu, 7 Apr 2022 10:53:48 +0200 Subject: [PATCH] fix autoselect for forced subs --- vod/hls/m3u8_builder.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vod/hls/m3u8_builder.c b/vod/hls/m3u8_builder.c index f484fa12..187346a9 100644 --- a/vod/hls/m3u8_builder.c +++ b/vod/hls/m3u8_builder.c @@ -969,7 +969,14 @@ m3u8_builder_ext_x_media_tags_write( } else { - p = vod_copy(p, M3U8_EXT_MEDIA_NON_DEFAULT, sizeof(M3U8_EXT_MEDIA_NON_DEFAULT) - 1); + if (tracks[media_type]->media_info.forced) + { + p = vod_copy(p, M3U8_EXT_MEDIA_AUTOSELECT, sizeof(M3U8_EXT_MEDIA_AUTOSELECT) - 1); + } + else + { + p = vod_copy(p, M3U8_EXT_MEDIA_NON_DEFAULT, sizeof(M3U8_EXT_MEDIA_NON_DEFAULT) - 1); + } } if (media_type == MEDIA_TYPE_AUDIO)