[MPlayer-dev-eng] [PATCH] [TEST AFILTER] Encode ac3 at runtime using lavc

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Mon Dec 10 18:45:49 CET 2007


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.

> +    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.

> +        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.

Greetings,
Reimar Döffinger



More information about the MPlayer-dev-eng mailing list