comparison libaf/af_lavcac3enc.c @ 36334:c1033e9288b1

Extract audio encoding code into a separate helper function.
author reimar
date Sun, 25 Aug 2013 11:30:43 +0000
parents dc90c43a2674
children f77a74ebb95e
comparison
equal deleted inserted replaced
36333:dc90c43a2674 36334:c1033e9288b1
227 else { 227 else {
228 in = src; 228 in = src;
229 src += s->expect_len; 229 src += s->expect_len;
230 left -= s->expect_len; 230 left -= s->expect_len;
231 } 231 }
232 if (c->nch >= 5) 232 len = lavc_encode_audio(s->lavc_actx, in, s->expect_len, dest, destsize);
233 reorder_channel_nch(in,
234 AF_CHANNEL_LAYOUT_MPLAYER_DEFAULT,
235 AF_CHANNEL_LAYOUT_LAVC_DEFAULT,
236 c->nch,
237 s->expect_len / 2, 2);
238 len = avcodec_encode_audio(s->lavc_actx, dest, destsize, in);
239 mp_msg(MSGT_AFILTER, MSGL_DBG2, "avcodec_encode_audio got %d, pending %d.\n", 233 mp_msg(MSGT_AFILTER, MSGL_DBG2, "avcodec_encode_audio got %d, pending %d.\n",
240 len, s->pending_len); 234 len, s->pending_len);
235 if (len < 0) len = 0;
241 236
242 if (s->add_iec61937_header) { 237 if (s->add_iec61937_header) {
243 int bsmod = dest[5] & 0x7; 238 int bsmod = dest[5] & 0x7;
244 239
245 AV_WB16(buf, 0xF872); // iec 61937 syncword 1 240 AV_WB16(buf, 0xF872); // iec 61937 syncword 1