[MPlayer-dev-eng] [PATCH] New command support select sub by source and ID

Ulion ulion2002 at gmail.com
Sat Nov 3 14:14:26 CET 2007


2007/11/3, Compn <tempn at twmi.rr.com>:
> On Sat, 3 Nov 2007 19:10:07 +0800, Ulion wrote:
>
> >2007/11/2, Ulion <ulion2002 at gmail.com>:
> >> 2007/11/2, Alban Bedel <albeu at free.fr>:
> >> > On Wed, 31 Oct 2007 22:54:46 +0800
> >> > Ulion <ulion2002 at gmail.com> wrote:
> >> >
> >> > > Hello,
> >> > >
> >> > > As a response for
> >> > > http://lists.mplayerhq.hu/pipermail/mplayer-users/2007-October/069452.html,
> >> > > I make this patch as a solution for accurate selecting subtitles
> >> > > by mplayer command.
> >> > > This hide the internal implement of mplayer global_sub_pos stuff.
> >> > > External program can now accurately select any subtitles
> >> > > identified by mplayer output message.
> >> > >
> >> > > There is another reason push me to make this patch:
> >> > > With this standard interface of selecting subtitles, we can then
> >> > > have chance to change internal implement of subtitles list
> >> > > without break programs using this interface in the future.
> >> >
> >> > > +                for (i = 0; set_prop_cmd[i].name; ++i)
> >> > > +                    if (set_prop_cmd[i].cmd ==
> >> > > MP_CMD_SUB_SELECT)
> >> > > +                        break;
> >> > > +                set_osd_msg(OSD_MSG_PROPERTY + i,
> >> > > +                        1, osd_duration, MSGTR_SubSelectStatus,
> >> > > val);
> >> >
> >> > That's not the right way to print a message with the same id as a
> >> > property. It should be done the otherway around, you define an id
> >> > and make the command-property bridge use it (ie. set the osd_id
> >> > field in the set_prop_cmd array).
> >> >
> >> > The patch itself look ok. However imho it would be much better to
> >> > add a new set of properties. One for each subtitle type to allow
> >> > setting/cycling only the given type, and one to query the current
> >> > subtitle type. The command could then be implemented in some
> >> > generic way, for example by using a string for the sub type and
> >> > just looking up the property sub_$type.
> >> >
> >> >         Albeu
> >> >
> >>
> >> That's a generic idea, I will consider to do it.
> >> About the property names, how about sub_source, sub_vob, sub_demux,
> >> sub_file?
> >>
> >
> >Here's the property version patch for select sub by source, how about
> >this one?
> >
> >
>
>
> if this patch is accepted, dont forget to update the table at the
> bottom of docs/tech/slave.txt as well :)
>
> -compn

Thank you for the notify, here's the updated version, combined with a
sub_source property range fix.

-- 
Ulion
-------------- next part --------------
A non-text attachment was scrubbed...
Name: select_sub_by_source_property2.diff
Type: text/x-diff
Size: 11342 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20071103/b1c6964a/attachment.diff>


More information about the MPlayer-dev-eng mailing list