diff options
-rw-r--r-- | apps/pcmbuf.c | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c index a75c110694..04e007f91d 100644 --- a/apps/pcmbuf.c +++ b/apps/pcmbuf.c | |||
@@ -157,26 +157,34 @@ static void pcmbuf_finish_crossfade_enable(void); | |||
157 | static struct chunkdesc *first_desc; | 157 | static struct chunkdesc *first_desc; |
158 | static bool show_desc_in_use = false; | 158 | static bool show_desc_in_use = false; |
159 | #define DISPLAY_DESC(caller) while(!show_desc(caller)) | 159 | #define DISPLAY_DESC(caller) while(!show_desc(caller)) |
160 | #define DESC_IDX(desc) (desc ? desc - first_desc : -1) | 160 | #define DESC_IDX(desc) (desc ? desc - first_desc : -1) |
161 | #define DESCL_IDX(desc) (desc && desc->link ? desc->link - first_desc : -1) | 161 | #define SHOW_DESC(desc) if(DESC_IDX(desc)==-1) DEBUGF("--"); \ |
162 | #define SHOW_1ST(desc) if(DESC_IDX (desc)==-1) DEBUGF(" -- "); \ | 162 | else DEBUGF("%02d", DESC_IDX(desc)) |
163 | else DEBUGF(" %02d ", DESC_IDX(desc)) | 163 | #define SHOW_DESC_LINK(desc) if(desc){SHOW_DESC(desc->link);DEBUGF(" ");} \ |
164 | #define SHOW_2ND(desc) if(DESCL_IDX(desc)==-1) DEBUGF("l -- "); \ | 164 | else DEBUGF("-- ") |
165 | else DEBUGF("l %02d ", DESCL_IDX(desc)) | 165 | #define SHOW_DETAIL(desc) DEBUGF(":");SHOW_DESC(desc); DEBUGF(">"); \ |
166 | #define DESC_SHOW(tag, desc) DEBUGF(tag);SHOW_1ST(desc); \ | 166 | SHOW_DESC_LINK(desc) |
167 | DEBUGF(tag);SHOW_2ND(desc) | 167 | #define SHOW_POINT(tag,desc) DEBUGF("%s",tag);SHOW_DETAIL(desc) |
168 | #define SHOW_NUM(num,desc) DEBUGF("%02d>",num);SHOW_DESC_LINK(desc) | ||
168 | 169 | ||
169 | static bool show_desc(char *caller) | 170 | static bool show_desc(char *caller) |
170 | { | 171 | { |
171 | if (show_desc_in_use) return false; | 172 | if (show_desc_in_use) return false; |
172 | show_desc_in_use = true; | 173 | show_desc_in_use = true; |
173 | DEBUGF("%-14s\t", caller); | 174 | DEBUGF("%-14s\t", caller); |
174 | DESC_SHOW("r", read_chunk); | 175 | SHOW_POINT("r", read_chunk); |
175 | DESC_SHOW("re", read_end_chunk); | 176 | SHOW_POINT("re", read_end_chunk); |
176 | DEBUGF(" "); | 177 | DEBUGF(" "); |
177 | DESC_SHOW("w", write_chunk); | 178 | SHOW_POINT("w", write_chunk); |
178 | DESC_SHOW("we", write_end_chunk); | 179 | SHOW_POINT("we", write_end_chunk); |
179 | DEBUGF("\n"); | 180 | DEBUGF("\n"); |
181 | int i; | ||
182 | for (i = 0; i < pcmbuf_descs(); i++) | ||
183 | { | ||
184 | SHOW_NUM(i, (first_desc + i)); | ||
185 | if (i%10 == 9) DEBUGF("\n"); | ||
186 | } | ||
187 | DEBUGF("\n\n"); | ||
180 | show_desc_in_use = false; | 188 | show_desc_in_use = false; |
181 | return true; | 189 | return true; |
182 | } | 190 | } |
@@ -223,6 +231,7 @@ static void commit_chunk(bool flush_next_time) | |||
223 | { | 231 | { |
224 | /* Flush! Discard all data after the currently playing chunk, | 232 | /* Flush! Discard all data after the currently playing chunk, |
225 | and make the current chunk play next */ | 233 | and make the current chunk play next */ |
234 | logf("commit_chunk: flush"); | ||
226 | write_end_chunk->link = read_chunk->link; | 235 | write_end_chunk->link = read_chunk->link; |
227 | read_chunk->link = pcmbuf_current; | 236 | read_chunk->link = pcmbuf_current; |
228 | while (write_end_chunk->link) | 237 | while (write_end_chunk->link) |
@@ -669,6 +678,7 @@ void pcmbuf_play_stop(void) | |||
669 | #endif | 678 | #endif |
670 | end_of_track = false; | 679 | end_of_track = false; |
671 | track_transition = false; | 680 | track_transition = false; |
681 | flush_pcmbuf = false; | ||
672 | DISPLAY_DESC("play_stop"); | 682 | DISPLAY_DESC("play_stop"); |
673 | 683 | ||
674 | /* Can unboost the codec thread here no matter who's calling */ | 684 | /* Can unboost the codec thread here no matter who's calling */ |