On Fri, Nov 06, 2009 at 07:20:10PM -0200, D?niel Fraga wrote: > 2) dvdnav:// > > The chosen subtitle (-slang pt) is not shown. So I have to > select it. > > And I noticed there're just 4 subtitles, which is nice, because > it is the correct number (we don't need repetition like "8 subtitles"). > But they are shown in the wrong order: > > 0) en <--- correct > 1) pt <--- wrong: it should be english (it displays english sub) > 2) en <--- wrong: it should be portuguese (it displays portuguese sub) > 3) pt <--- correct > > So if you reorder putting 0 and 2 first, then 1 and 3 after, it > will be correct. There is something seriously wrong, because this is the console output: subtitle ( sid ): 0 language: en ID_SID_0_LANG=en subtitle ( sid ): 2 language: en ID_SID_2_LANG=en subtitle ( sid ): 4 language: unknown subtitle ( sid ): 6 language: unknown So here the first 2 are detected as en. And there is also no "pt" language, I wonder where that suddenly pops out from. And according to this -sid 0 and -sid 2 should be english, -sid 4 and -sid 6 are for some reason detected as unknown... To be honest I really can't imagine I'm on the right track here, and I probably should better read up on libdvdnav first, but attached is a "fixed" version of the last patch, if we are on the right track it might fix -slang. > Ps: all this testing was done on the dvd "Revolutionary Road". > I'm only testing on this, so we can isolate what happens on this dvd. > After we fix it, then I can test on others (I have lots of dvds here), > but I think we're near the solution. Of course if someone can provide a cut-down rip (i.e. just enough to reproduce the issue, 100 MB at most) of such a problematic DVD that might speed things up. -------------- next part -------------- Index: stream/stream_dvdnav.c =================================================================== --- stream/stream_dvdnav.c (revision 29833) +++ stream/stream_dvdnav.c (working copy) @@ -547,9 +547,7 @@ for(i=0; i<32; i++) { char tmp[] = "unknown"; - lg = dvdnav_get_spu_logical_stream(nav, i); - if(lg == 0xff) continue; - lang = dvdnav_spu_stream_to_lang(nav, lg); + lang = dvdnav_spu_stream_to_lang(nav, i); if(lang != 0xFFFF) { tmp[0] = lang >> 8; @@ -795,9 +793,7 @@ 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; - lang = dvdnav_spu_stream_to_lang(priv->dvdnav, lg); + lang = dvdnav_spu_stream_to_lang(priv->dvdnav, k); if(lang != 0xFFFF && lang == lcode) { return k; } @@ -820,8 +816,7 @@ uint16_t lang; dvdnav_priv_t *priv = stream->priv; if(sid < 0) return 0; - lg = dvdnav_get_spu_logical_stream(priv->dvdnav, sid); - lang = dvdnav_spu_stream_to_lang(priv->dvdnav, lg); + lang = dvdnav_spu_stream_to_lang(priv->dvdnav, sid); if(lang == 0xffff) return 0; buf[0] = lang >> 8; buf[1] = lang & 0xFF;