Mercurial > libavcodec.hg
comparison libmp3lame.c @ 8570:e7992bb162b2 libavcodec
fix indention
author | michael |
---|---|
date | Sun, 11 Jan 2009 16:17:36 +0000 |
parents | ea663d76fcfa |
children | 77fc347409e7 |
comparison
equal
deleted
inserted
replaced
8569:ea663d76fcfa | 8570:e7992bb162b2 |
---|---|
173 BUFFER_SIZE - s->buffer_index | 173 BUFFER_SIZE - s->buffer_index |
174 ); | 174 ); |
175 } | 175 } |
176 | 176 |
177 if(lame_result < 0){ | 177 if(lame_result < 0){ |
178 if(lame_result==-1) { | 178 if(lame_result==-1) { |
179 /* output buffer too small */ | 179 /* output buffer too small */ |
180 av_log(avctx, AV_LOG_ERROR, "lame: output buffer too small (buffer index: %d, free bytes: %d)\n", s->buffer_index, BUFFER_SIZE - s->buffer_index); | 180 av_log(avctx, AV_LOG_ERROR, "lame: output buffer too small (buffer index: %d, free bytes: %d)\n", s->buffer_index, BUFFER_SIZE - s->buffer_index); |
181 } | 181 } |
182 return -1; | 182 return -1; |
183 } | 183 } |
184 | 184 |
185 s->buffer_index += lame_result; | 185 s->buffer_index += lame_result; |
186 | 186 |
187 if(s->buffer_index<4) | 187 if(s->buffer_index<4) |
188 return 0; | 188 return 0; |
189 | 189 |
190 len= mp3len(s->buffer, NULL, NULL); | 190 len= mp3len(s->buffer, NULL, NULL); |
191 //av_log(avctx, AV_LOG_DEBUG, "in:%d packet-len:%d index:%d\n", avctx->frame_size, len, s->buffer_index); | 191 //av_log(avctx, AV_LOG_DEBUG, "in:%d packet-len:%d index:%d\n", avctx->frame_size, len, s->buffer_index); |
192 if(len <= s->buffer_index){ | 192 if(len <= s->buffer_index){ |
193 memcpy(frame, s->buffer, len); | 193 memcpy(frame, s->buffer, len); |
194 s->buffer_index -= len; | 194 s->buffer_index -= len; |
195 | 195 |
196 memmove(s->buffer, s->buffer+len, s->buffer_index); | 196 memmove(s->buffer, s->buffer+len, s->buffer_index); |
197 //FIXME fix the audio codec API, so we do not need the memcpy() | 197 //FIXME fix the audio codec API, so we do not need the memcpy() |
198 /*for(i=0; i<len; i++){ | 198 /*for(i=0; i<len; i++){ |
199 av_log(avctx, AV_LOG_DEBUG, "%2X ", frame[i]); | 199 av_log(avctx, AV_LOG_DEBUG, "%2X ", frame[i]); |
200 }*/ | 200 }*/ |
201 return len; | 201 return len; |
202 }else | 202 }else |
203 return 0; | 203 return 0; |
204 } | 204 } |
205 | 205 |
206 static av_cold int MP3lame_encode_close(AVCodecContext *avctx) | 206 static av_cold int MP3lame_encode_close(AVCodecContext *avctx) |
207 { | 207 { |
208 Mp3AudioContext *s = avctx->priv_data; | 208 Mp3AudioContext *s = avctx->priv_data; |