[MPlayer-dev-eng] [PATCH] AVParser for audio support

Reimar Döffinger Reimar.Doeffinger at gmx.de
Wed Aug 26 22:09:53 CEST 2009


On Wed, Aug 26, 2009 at 10:52:48PM +0300, Uoti Urpala wrote:
> On Wed, 2009-08-26 at 19:42 +0200, Reimar Döffinger wrote:
> > Hello,
> > probably quite some room for improvements, though I think it is a good
> > step forward even if it is still a bit ugly.
> > It allows to use ffdca and ffac3 with the native AVI and MPEG demuxers.
> 
> IMO that code in ds_add_packet is quite ugly.

No question.

> How about doing the
> parsing in ad_ffmpeg? Is there a reason to expect a practical benefit
> from doing it elsewhere?

Well, what is the benefit of doing it in ad_ffmpeg? My incomplete attempt
looked at least as bad and won't even work with mencoder an -oac copy.

> Even if it's needed for multiple uses either
> adding a separate parsing function or doing parsing in demuxer.c
> functions when taking packets _out of_ the queue (so the information
> from the demuxer is kept intact in the queue) could be preferable.

On the other hand the information before parsing is unlikely to be really
too correct (particularly pts/dts). In case of AC3 in AVI there is also the
annoyance that packets seem to vary greatly in size (and thus duration)
before parsing.

> The new version you just posted fixes the pos/pts field loss that
> happened due to creating new packets, but doing special-case copies of
> those fields is still ugly.

There is a clone_packet function or something like that already, but it
seems it can't use a different size. Maybe there is a function that
does the right thing, if not it should probably be added.
The patch has not really reached the "make the code look nice" stage,
though I'd of course appreciate if someone else does that part.



More information about the MPlayer-dev-eng mailing list