[MPlayer-dev-eng] MEncoder: libass support (patch)

Uoti Urpala uoti.urpala at pp1.inet.fi
Wed Nov 7 14:48:28 CET 2007


On Wed, 2007-11-07 at 12:26 +0100, Nicolas George wrote:
> Le sextidi 16 brumaire, an CCXVI, Uoti Urpala a écrit :
> > The way it tries to handle A/V sync (which is badly broken),
> 
> Could you point me to the part of the code that handles it, both in mplayer
> and mencoder? I would like to understand how it work.

Sync means somewhat different things in MPlayer and MEncoder. MPlayer
syncs video position to the playing position of the external audio
device. MEncoder does something stupid which does not work.

You can use sleep_until_update() in mplayer.c as one starting point for
sync functionality and related variables, but it does involve code
elsewhere.

> >					    I'm not sure whether it would
> > be realistic to try keeping such a reimplementation of MEncoder
> > basically as an MPlayer vo compatible with the current MEncoder.
> 
> The more I think about it, the more I am convinced that this is the only way
> to go to avoid mencoder bitroting.

> So, obviously, unifying them would take a huge amount of work, but so would
> a "major rewrite" of mencoder. And I think the former could be more
> progressive.

I assumed the "major rewrite" would unify (most of) the code.

> But just for mow, I would like to have a better idea of what exactly would
> be needed.

If you intend to attempt that it will require getting some degree of
familiarity with quite a lot of MPlayer code.

> Thanks for the details. That seems reliable enough for a hash function in
> this case. Here is an updated patch.

This would probably work for struct glyph_hash_key_s, but leaves the
other hashed structs. struct ass_font_desc_s looks unlikely to have
padding but struct bitmap_hash_key_s almost certainly will have padding
(first 2 elements are char and a pointer).

Creating functions for them by hand like you did makes maintenance
harder as any change to the structs has to be done in at least 3 places.
It would be possible to generate the struct definition, comparison
function and hash function from one template with preprocessor tricks,
but that means the struct definition is not in the normal syntax and is
harder to read especially if you're not familiar with such tricks.
There's no particularly nice way to do such things in C...




More information about the MPlayer-dev-eng mailing list