Skip to content

Commit

Permalink
ServiceDVB - fix for subtitle track.
Browse files Browse the repository at this point in the history
- do not try get subtitle track, when ddvd_get_spu_byid returns -1
  • Loading branch information
ims committed Dec 19, 2024
1 parent 1e39e08 commit ed30dc4
Showing 1 changed file with 18 additions and 9 deletions.
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

0 comments on commit ed30dc4

Please sign in to comment.