[MPlayer-dev-eng] [PATCH] vobsub fix for empty useless streams

Ulion ulion2002 at gmail.com
Sun Aug 19 06:48:49 CEST 2007


Hello,

I found when switch between subs, empty vobsub streams are also rotated.
For example, the vobsub in following link:

https://www.shooter.cn/files/?fileid=29025&filename=Gladiator-Subs-oTo

It has two valid streams, one's vobsub id is 0, another's is 13. There
are lots of vobsubs with gaps between vobsub ids like this, mainly
caused by removing some unwanted streams from vobsub with many
streams.

When play movie with such vobsub files, if we switch subs, it will
take much our time to switch between many empty useless vobsub
streams. This does not make sense.

I made a patch for it to resolve the problem. Indeed, only two things
are changed:
1. When mplayer ask vobsub total index count, it return only valid
stream count instead of total stream count.
2. In old codes, if current using vobsubs, mpctx->global_sub_pos -
mpctx->global_sub_indices[SUB_SOURCE_VOBSUB] is just the vobsub_id.
Now, it's the index of current sub in valid vobsub streams, I add two
functions to convert between vobsub_id and the index in valid streams.

After applied the patch, when rotate subs, only valid vobsub streams
will be rotated. That's just what we want.

PS: Valid vobsub is judged by whether it has a id (language name), If
has no id, a stream will never be seeked by current code. So it's
totally useless.


-- 
Ulion
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vobsub_empty_sub_fix.patch
Type: application/octet-stream
Size: 4346 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20070819/a25c4663/attachment.obj>


More information about the MPlayer-dev-eng mailing list