From a813415ee7b1c1cae6d161749667c150e5370682 Mon Sep 17 00:00:00 2001 From: nicodvb Date: Sat, 25 Nov 2006 15:00:08 +0000 Subject: [PATCH] support for comma-separated language codes in -slang git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21220 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream_dvdnav.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/stream/stream_dvdnav.c b/stream/stream_dvdnav.c index 5652f573b4..25ec6b387a 100644 --- a/stream/stream_dvdnav.c +++ b/stream/stream_dvdnav.c @@ -466,8 +466,10 @@ void mp_dvdnav_update_mouse_pos(stream_t *stream, int32_t x, int32_t y, int* but 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]); + uint16_t lang, lcode; + while(language && strlen(language)>=2) { + 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; @@ -476,6 +478,9 @@ int dvdnav_sid_from_lang(stream_t *stream, unsigned char *language) { return k; } } + language += 2; + while(language[0]==',' || language[0]==' ') ++language; + } return -1; }