[Mplayer-advusers] BugFix proposal: "No subtitle displayed" Code included for "VobSub.c"
Nap
nap at xs4all.nl
Tue Jun 22 12:00:01 CEST 2004
Hi there developers,
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...
Branko, alias Nappie :-)
Holland.
Note: I posted this to "mplayer-users" yesterday, and realized it's the wrong group.
Sorry for that.
More information about the MPlayer-advusers
mailing list