From c6b75fbb73f68bd759187a4f2b5c1f7807e55074 Mon Sep 17 00:00:00 2001 From: Nicolas Pennequin Date: Wed, 10 Oct 2007 22:59:33 +0200 Subject: [PATCH] Clear warnings and more cleanup --- apps/buffering.c | 16 +++++++++------- apps/playback.c | 14 ++++++++++---- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/apps/buffering.c b/apps/buffering.c index a1686ecf5..044d550ce 100644 --- a/apps/buffering.c +++ b/apps/buffering.c @@ -427,7 +427,8 @@ static ssize_t buffer_handle(int handle_id) } DEBUGF("buffered %ld bytes (%ld of %ld available, rem: %ld, off: %ld)\n", - ret, h->available, h->filesize, h->filerem, h->offset); + (long)ret, (long)h->available, (long)h->filesize, + (long)h->filerem, (long)h->offset); return ret; } @@ -487,7 +488,7 @@ static void free_buffer(int handle_id) } DEBUGF("free_buffer(%d): metadata, moved by %ld bytes\n", - handle_id, delta); + handle_id, (long)delta); } else { @@ -498,7 +499,8 @@ static void free_buffer(int handle_id) h->data = RINGBUF_ADD(h->data, delta); h->available -= delta; h->offset += delta; - DEBUGF("free_buffer(%d): audio, %ld bytes freed\n", handle_id, delta); + DEBUGF("free_buffer(%d): audio, %ld bytes freed\n", + handle_id, (long)delta); } } @@ -614,7 +616,7 @@ int bufopen(char *file, size_t offset, enum data_type type) } DEBUGF("bufopen: %s (offset: %ld) (%ld bytes needed)...\n", - file, offset, size); + file, (long)offset, (long)size); struct memory_handle *h = add_handle(&size); if (!h) @@ -637,7 +639,7 @@ int bufopen(char *file, size_t offset, enum data_type type) close(fd); - DEBUGF("bufopen: allocated %ld bytes. ID: %d\n", size, h->id); + DEBUGF("bufopen: allocated %ld bytes. ID: %d\n", (long)size, h->id); #if 0 if (type == TYPE_CODEC || type == TYPE_CUESHEET || type == TYPE_IMAGE) { @@ -954,7 +956,7 @@ void buffering_thread(void) if (queue_empty(&buffering_queue) && data_rem() > 0 && wasted_space() > buffer_len/5) { - DEBUGF("there is %ld bytes of wasted space\n", wasted_space()); + DEBUGF("there is %ld bytes of wasted space\n", (long)wasted_space()); /* free buffer from outdated audio data */ struct memory_handle *m = first_handle; @@ -979,7 +981,7 @@ void buffering_thread(void) ata_disk_is_active() */) { DEBUGF("%ld bytes left to buffer and the buffer is low\n", - data_rem()); + (long)data_rem()); fill_buffer(); } /* else { sleep(HZ/2); diff --git a/apps/playback.c b/apps/playback.c index 9356e6935..7fd263098 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -2203,10 +2203,12 @@ static void codec_thread(void) /* --- Audio thread --- */ +#if 0 static bool audio_filebuf_is_lowdata(void) { return bufused() < AUDIO_FILEBUF_CRITICAL; } +#endif static bool audio_have_tracks(void) { @@ -2243,6 +2245,7 @@ long audio_filebufused(void) return (long) bufused(); } +#if 0 /* Count the data BETWEEN the selected tracks */ static size_t audio_buffer_count_tracks(int from_track, int to_track) { @@ -2264,6 +2267,7 @@ static size_t audio_buffer_count_tracks(int from_track, int to_track) } return amount; } +#endif static bool audio_buffer_wind_forward(int new_track_ridx, int old_track_ridx) { @@ -2348,6 +2352,7 @@ static void audio_update_trackinfo(void) ci.taginfo_ready = &CUR_TI->taginfo_ready; } +#if 0 /* Yield to codecs for as long as possible if they are in need of data * return true if the caller should break to let the audio thread process * new events */ @@ -2372,6 +2377,7 @@ static bool audio_yield_codecs(void) return false; } +#endif static void audio_clear_track_entries(bool clear_unbuffered) { @@ -2441,10 +2447,10 @@ static void audio_release_tracks(void) } } +#if 0 /* FIXME: This code should be made more generic and move to metadata.c */ static void audio_strip_tags(void) { -#if 0 int i; static const unsigned char tag[] = "TAG"; static const unsigned char apetag[] = "APETAGEX"; @@ -2504,8 +2510,8 @@ strip_ape_tag: tracks[track_widx].filesize -= len; } } -#endif } +#endif #if 0 /* Returns true if a whole file is read, false otherwise */ @@ -3301,9 +3307,9 @@ skip_done: return Q_CODEC_REQUEST_COMPLETE; } +#if 0 static int audio_rebuffer_and_seek(size_t newpos) { -#if 0 size_t real_preseek; int fd; char *trackname; @@ -3358,12 +3364,12 @@ static int audio_rebuffer_and_seek(size_t newpos) buf_ridx = RINGBUF_ADD(buf_ridx, real_preseek); -#endif (void)newpos; DEBUGF("/!\\ not implemented /!\\"); LOGFQUEUE("audio >|= codec Q_CODEC_REQUEST_COMPLETE"); return Q_CODEC_REQUEST_COMPLETE; } +#endif void audio_set_track_buffer_event(void (*handler)(struct mp3entry *id3, bool last_track)) -- 2.11.4.GIT