1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-25 08:12:17 +00:00

added code to identify subs language and count; needed for forthcoming support for -slang

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21213 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
nicodvb 2006-11-25 12:17:34 +00:00
parent 808bbc836a
commit 394129086b
2 changed files with 30 additions and 0 deletions

View File

@ -476,6 +476,34 @@ void mp_dvdnav_update_mouse_pos(stream_t *stream, int32_t x, int32_t y, int* but
priv->mousey = y;
}
int dvdnav_sid_from_lang(stream_t *stream, unsigned char *language) {
dvdnav_priv_t * priv=(dvdnav_priv_t*)stream->priv;
uint8_t format, lg, k;
uint16_t lang, lcode = (language[0] << 8) | (language[1]);
for(k=0; k<32; k++) {
lg = dvdnav_get_spu_logical_stream(priv->dvdnav, k);
if(lg == 0xff) continue;
lang = dvdnav_spu_stream_to_lang(priv->dvdnav, lg);
if(lang != 0xFFFF && lang == lcode) {
return k;
}
}
return -1;
}
int dvdnav_number_of_subs(stream_t *stream) {
dvdnav_priv_t * priv=(dvdnav_priv_t*)stream->priv;
uint8_t lg, k, n=0;
for(k=0; k<32; k++) {
lg = dvdnav_get_spu_logical_stream(priv->dvdnav, k);
if(lg == 0xff) continue;
n++;
}
return n;
}
stream_info_t stream_info_dvdnav = {
"DVDNAV stream",

View File

@ -33,6 +33,8 @@ extern int osd_show_dvd_nav_ex;
extern int osd_show_dvd_nav_sy;
extern int osd_show_dvd_nav_ey;
int dvdnav_number_of_subs(stream_t *stream);
int dvdnav_sid_from_lang(stream_t *stream, unsigned char *language);
int mp_dvdnav_handle_input(stream_t *stream, int cmd, int *button);
void mp_dvdnav_update_mouse_pos(stream_t *stream, int32_t x, int32_t y, int* button);