diff options
author | nicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-11-25 12:17:34 +0000 |
---|---|---|
committer | nicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-11-25 12:17:34 +0000 |
commit | 394129086bb121d52350b0fcc90a7bcbcc2b7d76 (patch) | |
tree | 45ac9e68e66e3e0aef29564444e05c7e9f53c498 /stream | |
parent | 808bbc836ab9d68c7a41803b5e175128a74c9bd6 (diff) | |
download | mpv-394129086bb121d52350b0fcc90a7bcbcc2b7d76.tar.bz2 mpv-394129086bb121d52350b0fcc90a7bcbcc2b7d76.tar.xz |
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
Diffstat (limited to 'stream')
-rw-r--r-- | stream/stream_dvdnav.c | 28 | ||||
-rw-r--r-- | stream/stream_dvdnav.h | 2 |
2 files changed, 30 insertions, 0 deletions
diff --git a/stream/stream_dvdnav.c b/stream/stream_dvdnav.c index a70d64bc5f..8c7611f544 100644 --- a/stream/stream_dvdnav.c +++ b/stream/stream_dvdnav.c @@ -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", diff --git a/stream/stream_dvdnav.h b/stream/stream_dvdnav.h index cd097936d2..7790a75c6c 100644 --- a/stream/stream_dvdnav.h +++ b/stream/stream_dvdnav.h @@ -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); |