[Mplayer-advusers] BugFix proposal: "No subtitle displayed" Code included for "VobSub.c"

Diego Biurrun diego at biurrun.de
Mon Aug 30 16:11:08 CEST 2004


Nap writes:
>  
> I am new here and I am not a developer.
> But I wrote a few lines of code to solve a tiny bug (rather a 'nag'). I like to share it with you.
> Hopefully it could be used in the project. As till cvs 20040622 the 'bug' still exists.
>  
> Symptoms:
>         When using "vobsub" sometimes there will be no subtitle displayed.
> Cause:
>         It occurs when "langidx:" parameter in .idx contains an id and this id is not defined as a language.
>         Vobsub.c will contain no valid lang-id in var "vobsub_id" and will not display a subtitle at startup.
>         I have seen this behaviour many times in vobsub v7 generated idx files.
> Test file:
>         Take an .avi with a vobsub .idx and .sub.
>         Edit .idx file; change value for "langidx:" like below: 
>         ("langidx:" value must differ from all "index:" values)
>                  langidx: 0
>                  id: hu, index: 6
>         (meaning "choose langidx 0 as default. Langid "hu" is defined as langidx 6)
> Solution code placement:
>         Module: "VobSub.c"
>         Function: "vobsub_open"
>                        right after line:
>                        *spu = spudec_new_scaled_vobsub(........);
> Code:
> /*================================================================*/
> (...)
> void *
> vobsub_open(...)
> (...) need declare i
>      int i;
> (...) next code to be placed after line: *spu = spudec_new_scaled_vobsub(........);
>      /* If langidx: in .idx is not a valid id then take the first one available */
>      if ((vobsub_id < 0) || (vobsub_id >= vob->spu_streams_size) || !(vob->spu_streams[vobsub_id].id)) {
>       /* vobsub_id is the default language, if it is not present in stream we
>          need to select another one. Just take the first available */
>       vobsub_id = -1;
>       for (i = 0; i < vob->spu_streams_size; i++) 
>                if (vob->spu_streams[i].id) {
>                     vobsub_id = i;
>                     break;}
>      }
> /*================================================================*/
> 
> Could someone make this change and test it ?
> Hopefully it could be used in your project.
> Thanx allot and keep up the good work...

Please read DOCS/tech/patches.txt, convert this into a patch and send
it to mplayer-dev-eng.
Thanks

Diego




More information about the MPlayer-advusers mailing list