Mercurial > mplayer.hg
comparison libaf/af_channels.c @ 7589:443b440798a5
Redesign of buffer length calculation
author | anders |
---|---|
date | Thu, 03 Oct 2002 12:02:46 +0000 |
parents | a0bba1b6c458 |
children | 0cba73469341 |
comparison
equal
deleted
inserted
replaced
7588:8ee95f554262 | 7589:443b440798a5 |
---|---|
120 if(AF_OK != RESIZE_LOCAL_BUFFER(af,data)) | 120 if(AF_OK != RESIZE_LOCAL_BUFFER(af,data)) |
121 return NULL; | 121 return NULL; |
122 | 122 |
123 // Reset unused channels if nch in < nch out | 123 // Reset unused channels if nch in < nch out |
124 if(af->mul.n > af->mul.d) | 124 if(af->mul.n > af->mul.d) |
125 memset(l->audio,0,af_lencalc(af->mul, c->len)); | 125 memset(l->audio,0,af_lencalc(af->mul, c)); |
126 | 126 |
127 // Special case always output L & R | 127 // Special case always output L & R |
128 if(c->nch == 1){ | 128 if(c->nch == 1){ |
129 copy(c->audio,l->audio,1,0,l->nch,0,c->len,c->bps); | 129 copy(c->audio,l->audio,1,0,l->nch,0,c->len,c->bps); |
130 copy(c->audio,l->audio,1,0,l->nch,1,c->len,c->bps); | 130 copy(c->audio,l->audio,1,0,l->nch,1,c->len,c->bps); |
141 } | 141 } |
142 } | 142 } |
143 | 143 |
144 // Set output data | 144 // Set output data |
145 c->audio = l->audio; | 145 c->audio = l->audio; |
146 c->len = af_lencalc(af->mul, c->len); | 146 c->len = af_lencalc(af->mul, c); |
147 c->nch = l->nch; | 147 c->nch = l->nch; |
148 | 148 |
149 return c; | 149 return c; |
150 } | 150 } |
151 | 151 |