From 9ff373cb6574675b9ae03c92d604b7ae87e39156 Mon Sep 17 00:00:00 2001 From: Miika Pekkarinen Date: Fri, 10 Jun 2005 20:29:35 +0000 Subject: Fixed a null pointer problem which caused crashing. Playback should be now more stable. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6660 a1c6a512-1295-4272-9138-f99709370657 --- apps/playback.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'apps/playback.c') diff --git a/apps/playback.c b/apps/playback.c index a804103006..3e046fad6c 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -261,6 +261,7 @@ void* codec_request_buffer_callback(size_t *realsize, size_t reqsize) while ((int)*realsize > cur_ti->available) { yield(); if (ci.stop_codec) { + *realsize = 0; return NULL; } } @@ -286,7 +287,7 @@ void codec_advance_buffer_callback(size_t amount) codecbufused = 0; buf_ridx = buf_widx; cur_ti->available = 0; - while ((int)amount < cur_ti->available) + while ((int)amount < cur_ti->available && !ci.stop_codec) yield(); } else { cur_ti->available -= amount; @@ -427,7 +428,8 @@ void yield_codecs(void) #ifndef SIMULATOR if (!pcm_is_playing()) sleep(5); - while (pcm_is_lowdata()) + while (pcm_is_lowdata() && !ci.stop_codec && + playing && queue_empty(&audio_queue)) yield(); #else yield(); -- cgit v1.2.3