[MPlayer-dev-eng] [PATCH] [TEST AFILTER] Encode ac3 at runtime using lavc
Ulion
ulion2002 at gmail.com
Tue Dec 11 07:40:29 CET 2007
2007/12/11, Reimar Döffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de>:
> Hello,
> On Tue, Dec 11, 2007 at 01:18:28AM +0800, Ulion wrote:
> [...]
> > +.IPs <srate>
> > +Selects the output sample rate to be used, supports 48000, 44100, or 32000.
>
> Can't the sample be achieved by adding e.g. lavcresample=... in front of
> that? If yes I am against having yet another way to do the same thing.
Oh, then removed with man page update.
>
> > + while (left > 0/* || c->eof && s->pending_len > 0*/) {
> > + if (left + s->pending_len < s->expect_len) {
> > +// if (left > 0) {
> > + memcpy(s->pending_data + s->pending_len, src, left);
> > + src += left;
> > + s->pending_len += left;
> > + left = 0;
> > +// }
> > +// if (!c->eof)
> > + break;
> > +// memset(s->pending_data + s->pending_len, 0, s->expect_len - s->pending_len);
> > +// s->pending_len = s->expect_len;
> > + }
>
> I do not like loads of having commented-out code in new code.
> The same applies to all those af_msg, either they are useful then
> they should be enable (possibly at DBG or DBG2 level) or they are not
> and should go completely.
OK, fixed.
>
> > + if (s->add_iec61937_header) {
> > + int16_t *out = (int16_t *)buf;
> > + out[0] = 0xF872; // iec 61937 syncword 1
> > + out[1] = 0x4E1F; // iec 61937 syncword 2
> > + out[2] = 0x0001; // data-type ac3
> > + out[2] |= (buf[8+5] & 0x7) << 8; // bsmod
> > + out[3] = len << 3; // number of bits in payload
> > +
> > +#ifndef WORDS_BIGENDIAN
> > + swab(buf + 8, buf + 8, len);
>
> As said before this is not a valid way to use swab, it does not have to
> work for from == to.
> And this code wouldn't be needed at all if we can just get the ac3
> endianness stuff done first.
Fixed. As the ac3 endianness stuff, it indeed should be spdif or
iec958 endianness, and wiith a inner format flag, that's another
unfinished discussion.
Updated patch is here. If there's no objection, I will commit it in 2 days.
--
Ulion
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: af_lavcac3enc17.diff
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20071211/0ff745b1/attachment.asc>
More information about the MPlayer-dev-eng
mailing list