Lines 190-196
Link Here
|
190 |
|
190 |
|
191 |
static void play (char *filename) { |
191 |
static void play (char *filename) { |
192 |
|
192 |
|
193 |
speex_comment_t comments; |
193 |
speex_comment_t comments = {0}; |
194 |
|
194 |
|
195 |
if (speex_fs == NULL) |
195 |
if (speex_fs == NULL) |
196 |
speex_fs = malloc(sizeof(Speex_File_State)); |
196 |
speex_fs = malloc(sizeof(Speex_File_State)); |
Lines 215-223
Link Here
|
215 |
} |
215 |
} |
216 |
else |
216 |
else |
217 |
{ |
217 |
{ |
218 |
speex_file_info(filename, NULL, &comments, &speex_fs->length); |
218 |
if (!speex_file_info(filename, NULL, &comments, &speex_fs->length)) |
219 |
speex_fs->length *= 1000; |
219 |
{ |
220 |
speex_fs->title = generate_title(filename, &comments); |
220 |
speex_fs->length *= 1000; |
|
|
221 |
speex_fs->title = generate_title(filename, &comments); |
222 |
} |
223 |
speex_comment_free(&comments); |
221 |
} |
224 |
} |
222 |
|
225 |
|
223 |
|
226 |
|
Lines 235-240
Link Here
|
235 |
fprintf(stderr, PACKAGE ": error opening file\n"); |
238 |
fprintf(stderr, PACKAGE ": error opening file\n"); |
236 |
#endif |
239 |
#endif |
237 |
|
240 |
|
|
|
241 |
speex_fs->playing = FALSE; |
238 |
return; |
242 |
return; |
239 |
} |
243 |
} |
240 |
} |
244 |
} |
Lines 265-271
Link Here
|
265 |
SpeexBits sbits; |
269 |
SpeexBits sbits; |
266 |
SpeexStereoState stereo = SPEEX_STEREO_STATE_INIT; |
270 |
SpeexStereoState stereo = SPEEX_STEREO_STATE_INIT; |
267 |
|
271 |
|
268 |
speex_comment_t comments; |
272 |
speex_comment_t comments = {0}; |
269 |
int valid_comment; |
273 |
int valid_comment; |
270 |
|
274 |
|
271 |
#ifdef DEBUG |
275 |
#ifdef DEBUG |
Lines 404-411
Link Here
|
404 |
if (valid_comment) |
408 |
if (valid_comment) |
405 |
{ |
409 |
{ |
406 |
speex_fs->title = generate_title(NULL, &comments); |
410 |
speex_fs->title = generate_title(NULL, &comments); |
407 |
speex_comment_free(&comments); |
|
|
408 |
} |
411 |
} |
|
|
412 |
speex_comment_free(&comments); |
409 |
} |
413 |
} |
410 |
|
414 |
|
411 |
} |
415 |
} |
Lines 672-682
Link Here
|
672 |
} |
676 |
} |
673 |
|
677 |
|
674 |
static void stop (void) { |
678 |
static void stop (void) { |
675 |
speex_fs->playing = FALSE; |
679 |
if (speex_fs->playing == TRUE) |
|
|
680 |
{ |
681 |
speex_fs->playing = FALSE; |
676 |
|
682 |
|
677 |
// Wait for the thread to close |
683 |
// Wait for the thread to close |
678 |
pthread_join(spx_decode_thread, NULL); |
684 |
pthread_join(spx_decode_thread, NULL); |
679 |
|
685 |
} |
680 |
#ifdef DEBUG |
686 |
#ifdef DEBUG |
681 |
fprintf(stderr, PACKAGE ": stop\n"); |
687 |
fprintf(stderr, PACKAGE ": stop\n"); |
682 |
#endif |
688 |
#endif |
Lines 707-713
Link Here
|
707 |
|
713 |
|
708 |
static void get_song_info (char *filename, char **title, int *length) { |
714 |
static void get_song_info (char *filename, char **title, int *length) { |
709 |
|
715 |
|
710 |
speex_comment_t comments; |
716 |
speex_comment_t comments = {0}; |
711 |
|
717 |
|
712 |
#ifdef DEBUG |
718 |
#ifdef DEBUG |
713 |
fprintf(stderr, "get_song_info\n"); |
719 |
fprintf(stderr, "get_song_info\n"); |
Lines 720-729
Link Here
|
720 |
} |
726 |
} |
721 |
else |
727 |
else |
722 |
{ |
728 |
{ |
723 |
speex_file_info(filename, NULL, &comments, length); |
729 |
if(!speex_file_info(filename, NULL, &comments, length)) |
724 |
*length *= 1000; |
730 |
{ |
725 |
(*title) = g_strdup(generate_title(filename, &comments)); |
731 |
*length *= 1000; |
726 |
|
732 |
(*title) = generate_title(filename, &comments); |
|
|
733 |
} |
727 |
speex_comment_free(&comments); |
734 |
speex_comment_free(&comments); |
728 |
} |
735 |
} |
729 |
|
736 |
|