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

ServiceDVD - fix for subtitle track. #4140

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions lib/service/servicedvd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -822,16 +822,25 @@ RESULT eServiceDVD::getSubtitleList(std::vector<struct SubtitleTrack> &subtitlel
{
struct SubtitleTrack track = {};
uint16_t spu_lang;

ddvd_get_spu_byid(m_ddvdconfig, spu_id, &spu_lang);
char spu_string[3]={(char) ((spu_lang >> 8) & 0xff), (char)(spu_lang & 0xff), 0};
eDebug("[eServiceDVD] getSubtitleList: spu_id=%d lang=%s", spu_id, spu_string);

track.type = 2;
track.pid = spu_id + 1;
track.page_number = 5;
track.magazine_number = 0;
track.language_code = spu_string;
subtitlelist.push_back(track);
if (spu_lang != 0xFFFF)
{
char spu_string[3] = {(char)((spu_lang >> 8) & 0xff), (char)(spu_lang & 0xff), 0};
eDebug("[eServiceDVD] getSubtitleList: spu_id=%d lang=%s", spu_id, spu_string);

track.type = 2;
track.pid = spu_id + 1;
track.page_number = 5;
track.magazine_number = 0;
track.language_code = spu_string;
subtitlelist.push_back(track);

}
else
{
eDebug("[eServiceDVD] getSubtitleList: spu_id=%d: invalid subtitle track", spu_id);
}
}
return 0;
}
Expand Down