diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/pcmbuf.c | 4 | ||||
-rw-r--r-- | apps/playback.c | 5 |
2 files changed, 3 insertions, 6 deletions
diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c index cf6911b606..a8769e3829 100644 --- a/apps/pcmbuf.c +++ b/apps/pcmbuf.c | |||
@@ -202,8 +202,8 @@ unsigned int pcmbuf_get_latency(void) | |||
202 | { | 202 | { |
203 | int latency; | 203 | int latency; |
204 | 204 | ||
205 | /* This has to be done better. */ | 205 | latency = (pcmbuf_unplayed_bytes + pcm_get_bytes_waiting()) |
206 | latency = (pcmbuf_size - audiobuffer_free - CHUNK_SIZE)/4 / (44100/1000); | 206 | / 4 / (44100/1000); |
207 | if (latency < 0) | 207 | if (latency < 0) |
208 | latency = 0; | 208 | latency = 0; |
209 | 209 | ||
diff --git a/apps/playback.c b/apps/playback.c index aadb1e289e..7aaff01e54 100644 --- a/apps/playback.c +++ b/apps/playback.c | |||
@@ -265,10 +265,7 @@ void codec_set_offset_callback(unsigned int value) | |||
265 | if (ci.stop_codec) | 265 | if (ci.stop_codec) |
266 | return ; | 266 | return ; |
267 | 267 | ||
268 | /* The 1000 here is a hack. pcmbuf_get_latency() should | 268 | latency = pcmbuf_get_latency() * cur_ti->id3.bitrate / 8; |
269 | * be more accurate | ||
270 | */ | ||
271 | latency = (pcmbuf_get_latency() + 1000) * cur_ti->id3.bitrate / 8; | ||
272 | 269 | ||
273 | if (value < latency) { | 270 | if (value < latency) { |
274 | cur_ti->id3.offset = 0; | 271 | cur_ti->id3.offset = 0; |