[MPlayer-dev-eng] [PATCH] subtitle reload, slave mode - 2nd try

Salvatore Falco sfalco at studenti.ing.uniroma1.it
Wed Oct 13 14:42:56 CEST 2004


On Wed, Oct 13, 2004 at 07:11:00AM -0400, kiriuja wrote:
> I would expect the first subtitle file you give MPlayer to have the index 0,
> the second one to have the index 1, and so on. Is that not the case? A host
> program should have no problem keeping track of subtitles it passed to MPlayer.

    Remember the autosubload feature, you can end with MPlayer loading more subs
than you passed it. However, with a clever use of -noautosub switch, it is possible
to do what you expect.

> Plus of course using an index would eliminate that for loop with string
> comparison you have in your patch, so it would be more efficient, too.

    That's the strongest point of your proposal.

> I am pretty sure that the slave mode is only supposed to be used by frontends
> rather than end users. But in either case, if a command called sub_reload adds
> a subtitle rather than reloads it, that would look like a rather ugly hack.

    If we decide to allow this command to add subs, its name would be changed to,
for example, sub_manage, or something like that.

> Another thing: how are spaces in file/directory names handled? Especially with
> two path arguments it would be a pretty bad mess, you'd pretty much have to
> URL encode them. With one index and one path it would be possible to have a
> non-encoded path, but for that the index would have to be the first argument.

    After a quick look at input.c, I can tell you can put the filename between
'"' in order to 'escape' the filename.

    So far, it looks the main advantage of your proposal is it avoids the loop to
search the sub_data structure among those already present, saving some strcmp.
    Its main disavantage is, IMO, it relies on an assumption (the subs are loaded
and placed sequentially) that is true now, but could be broke in future.

    Best regards, Salvatore




More information about the MPlayer-dev-eng mailing list