[MPlayer-dev-eng] [PATCH] ae_lavc: set nBlockAlign like libavformat

Nicolas George nicolas.george at normalesup.org
Sun Aug 28 00:28:27 CEST 2011


Le decadi 10 fructidor, an CCXIX, Reimar Döffinger a écrit :
> Well, for some codecs the "customary" value if such exists might be
> better.

Apparently, for MP[23], the customary value is in fact the frame size, 1152.
I dug a file produced by "Nandub" that had the same value, and I read this
in our ae_lame.c:

mux_a->wf->nBlockAlign=encoder->params.samples_per_frame; // required for l3codeca.acm + WMP 6.4

Also, a comment in the source code of lame itself (reservoir.c) indicates
that the absolute maximum size for en encoded frame is 960, and 960 < 1152.

> For others something extreme like 0xfffffff (255 MB or so) might be
> simpler and more reliable, particularly since I do not know whether all
> codecs set frame_size.

AVCODEC_MAX_AUDIO_FRAME_SIZE would probably be enough.

> With -oac copy we probably won't have much choice if the input file is
> in such a format.

-oac copy is another problem. And AVI is inherently limited, especially to
constant frame rate, or something that must really look like it. It may not
be possible to remux some corner case.

If we can get the normal cases working, that's already good.

> The muxer mostly takes the values as they come from the demuxer, sight
> unseen.
> This works with the mkv demuxer that keeps the dwScale/dwRate as they
> are, based on bitrate.
> For demuxer lavf I guess there are two ways to fix it: Also keeping
> dwScale/dwRate (will break other things) or by using the same logic
> as you suggest for ae_lavc -

I see your point. I had not realized how much the core code is specialized
for the AVI format.

>				but then that IMO should not be duplicated
> but go into some shared file.

Probably, yes, if the logic can be shared enough.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20110828/c093dccb/attachment.asc>


More information about the MPlayer-dev-eng mailing list