Mercurial > audlegacy-plugins
comparison src/madplug/decoder.c @ 627:8829833d37bc trunk
[svn] Break out of the loop once we know the length. No using spinning around all day.
| author | chainsaw |
|---|---|
| date | Sat, 10 Feb 2007 12:06:11 -0800 |
| parents | ca4cd00ca0c8 |
| children | 8ed0af226d0e |
comparison
equal
deleted
inserted
replaced
| 626:d21c61c27373 | 627:8829833d37bc |
|---|---|
| 207 if (len <= 0) | 207 if (len <= 0) |
| 208 break; | 208 break; |
| 209 | 209 |
| 210 mad_stream_buffer(&stream, buffer, len + remainder); | 210 mad_stream_buffer(&stream, buffer, len + remainder); |
| 211 | 211 |
| 212 while (1) { | 212 while (info->duration.seconds == 0) { |
| 213 if (mad_header_decode(&header, &stream) == -1) { | 213 if (mad_header_decode(&header, &stream) == -1) { |
| 214 if (stream.error == MAD_ERROR_BUFLEN) { | 214 if (stream.error == MAD_ERROR_BUFLEN) { |
| 215 break; | 215 break; |
| 216 } | 216 } |
| 217 if (!MAD_RECOVERABLE(stream.error)) { | 217 if (!MAD_RECOVERABLE(stream.error)) { |
| 309 mad_timer_multiply(&info->duration, info->frames); | 309 mad_timer_multiply(&info->duration, info->frames); |
| 310 #ifdef DEBUG | 310 #ifdef DEBUG |
| 311 g_message("using fast playtime calculation"); | 311 g_message("using fast playtime calculation"); |
| 312 g_message("data used = %d [tagsize=%d framesize=%f]", | 312 g_message("data used = %d [tagsize=%d framesize=%f]", |
| 313 data_used, tagsize, frame_size); | 313 data_used, tagsize, frame_size); |
| 314 g_message("frames = %d, frequecy = %d, channels = %d", | 314 g_message("frames = %d, frequency = %d, channels = %d", |
| 315 info->frames, info->freq, info->channels); | 315 info->frames, info->freq, info->channels); |
| 316 long millis = mad_timer_count(info->duration, | 316 long millis = mad_timer_count(info->duration, |
| 317 MAD_UNITS_MILLISECONDS); | 317 MAD_UNITS_MILLISECONDS); |
| 318 g_message("duration = %lu:%lu", millis / 1000 / 60, | 318 g_message("duration = %lu:%lu", millis / 1000 / 60, |
| 319 (millis / 1000) % 60); | 319 (millis / 1000) % 60); |
