[MPlayer-users] DVDNAV problem: subtitles

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Nov 7 10:37:07 CET 2009


On Sat, Nov 07, 2009 at 12:11:41AM -0200, Dâniel Fraga wrote:
> On Fri, 6 Nov 2009 23:37:09 +0100
> Reimar Döffinger <Reimar.Doeffinger at gmx.de> wrote:
> 
> > 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
> 
> 	Yes, it must be a libdvdnav issue. I understand you're in a
> complicated situation looking into other people's broken code.

Well, it probably is MPlayer's code that is broken. It still isn't my
code though.

> > a "fixed" version of the last patch, if we are on the right track it
> > might fix -slang.
> 
> 	Ok, it really fixed the slang issue, BUT as I have the problem
> above (subtitles out of order) it shows the english subtitle even if it
> selected the corret one (1) pt. So if you can fix the above problem,
> this issue will be gone.

Try attached patch, probably fixes slang but the other issue probably
return.

> 	And a small detail: it fixed the -slang issue if I use
> dvdnav://8 only. In other words, I lose the benefit of dvdnav
> (navigating through menus, looking into extras etc). If I use dvdnav://
> the -slang will not work.

I guess that is what the code that I removed with the previous patch was
supposed to fix, however it couldn't really work properly.
-------------- next part --------------
Index: stream/stream_dvdnav.c
===================================================================
--- stream/stream_dvdnav.c	(revision 29833)
+++ stream/stream_dvdnav.c	(working copy)
@@ -556,9 +556,9 @@
       tmp[1] = lang & 0xFF;
       tmp[2] = 0;
     }
-    mp_msg(MSGT_OPEN,MSGL_STATUS,MSGTR_DVDsubtitleLanguage, i, tmp);
+    mp_msg(MSGT_OPEN,MSGL_STATUS,MSGTR_DVDsubtitleLanguage, lg, tmp);
     if (lang != 0xFFFF && lang && tmp[0])
-        mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_SID_%d_LANG=%s\n", i, tmp);
+        mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_SID_%d_LANG=%s\n", lg, tmp);
   }
 }
 
@@ -799,7 +799,7 @@
       if(lg == 0xff) continue;
       lang = dvdnav_spu_stream_to_lang(priv->dvdnav, lg);
       if(lang != 0xFFFF && lang == lcode) {
-        return k;
+        return lg;
       }
     }
     language += 2;
@@ -820,8 +820,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;


More information about the MPlayer-users mailing list