diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/mpeg.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/apps/mpeg.c b/apps/mpeg.c index 1ba491ce89..62fda5e3cb 100644 --- a/apps/mpeg.c +++ b/apps/mpeg.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include "sound.h" | 40 | #include "sound.h" |
41 | #include "bitswap.h" | 41 | #include "bitswap.h" |
42 | #include "appevents.h" | 42 | #include "appevents.h" |
43 | #include "playlist.h" | ||
43 | #include "cuesheet.h" | 44 | #include "cuesheet.h" |
44 | #include "settings.h" | 45 | #include "settings.h" |
45 | #ifndef SIMULATOR | 46 | #ifndef SIMULATOR |
@@ -87,12 +88,6 @@ extern enum /* from mp3_playback.c */ | |||
87 | } mpeg_mode; | 88 | } mpeg_mode; |
88 | #endif /* CONFIG_CODEC == MAS3587F */ | 89 | #endif /* CONFIG_CODEC == MAS3587F */ |
89 | 90 | ||
90 | extern const char* playlist_peek(int steps); | ||
91 | extern bool playlist_check(int steps); | ||
92 | extern int playlist_next(int steps); | ||
93 | extern int playlist_amount(void); | ||
94 | extern int playlist_update_resume_info(const struct mp3entry* id3); | ||
95 | |||
96 | #define MPEG_PLAY 1 | 91 | #define MPEG_PLAY 1 |
97 | #define MPEG_STOP 2 | 92 | #define MPEG_STOP 2 |
98 | #define MPEG_PAUSE 3 | 93 | #define MPEG_PAUSE 3 |
@@ -914,6 +909,8 @@ static int new_file(int steps) | |||
914 | int start = 0; | 909 | int start = 0; |
915 | int i; | 910 | int i; |
916 | struct trackdata *track; | 911 | struct trackdata *track; |
912 | char name_buf[MAX_PATH+1]; | ||
913 | const char *trackname; | ||
917 | 914 | ||
918 | /* Find out how many steps to advance. The load_ahead_index field tells | 915 | /* Find out how many steps to advance. The load_ahead_index field tells |
919 | us how many playlist entries it had to skip to get to a valid one. | 916 | us how many playlist entries it had to skip to get to a valid one. |
@@ -929,9 +926,7 @@ static int new_file(int steps) | |||
929 | } | 926 | } |
930 | 927 | ||
931 | do { | 928 | do { |
932 | const char *trackname; | 929 | trackname = playlist_peek(start + steps, name_buf, sizeof(name_buf)); |
933 | |||
934 | trackname = playlist_peek( start + steps ); | ||
935 | if ( !trackname ) | 930 | if ( !trackname ) |
936 | return -1; | 931 | return -1; |
937 | 932 | ||
@@ -2653,13 +2648,14 @@ void audio_set_recording_options(struct audio_recording_options *options) | |||
2653 | void audio_play(long offset) | 2648 | void audio_play(long offset) |
2654 | { | 2649 | { |
2655 | #ifdef SIMULATOR | 2650 | #ifdef SIMULATOR |
2651 | char name_buf[MAX_PATH+1]; | ||
2656 | const char* trackname; | 2652 | const char* trackname; |
2657 | int steps=0; | 2653 | int steps=0; |
2658 | 2654 | ||
2659 | is_playing = true; | 2655 | is_playing = true; |
2660 | 2656 | ||
2661 | do { | 2657 | do { |
2662 | trackname = playlist_peek( steps ); | 2658 | trackname = playlist_peek(steps, name_buf, sizeof(name_buf)); |
2663 | if (!trackname) | 2659 | if (!trackname) |
2664 | break; | 2660 | break; |
2665 | if(mp3info(&taginfo, trackname)) { | 2661 | if(mp3info(&taginfo, trackname)) { |
@@ -2740,12 +2736,13 @@ void audio_next(void) | |||
2740 | queue_remove_from_head(&mpeg_queue, MPEG_NEED_DATA); | 2736 | queue_remove_from_head(&mpeg_queue, MPEG_NEED_DATA); |
2741 | queue_post(&mpeg_queue, MPEG_NEXT, 0); | 2737 | queue_post(&mpeg_queue, MPEG_NEXT, 0); |
2742 | #else /* SIMULATOR */ | 2738 | #else /* SIMULATOR */ |
2739 | char name_buf[MAX_PATH+1]; | ||
2743 | const char* file; | 2740 | const char* file; |
2744 | int steps = 1; | 2741 | int steps = 1; |
2745 | int index; | 2742 | int index; |
2746 | 2743 | ||
2747 | do { | 2744 | do { |
2748 | file = playlist_peek(steps); | 2745 | file = playlist_peek(steps, name_buf, sizeof(name_buf)); |
2749 | if(!file) | 2746 | if(!file) |
2750 | break; | 2747 | break; |
2751 | if(mp3info(&taginfo, file)) { | 2748 | if(mp3info(&taginfo, file)) { |
@@ -2769,12 +2766,13 @@ void audio_prev(void) | |||
2769 | queue_remove_from_head(&mpeg_queue, MPEG_NEED_DATA); | 2766 | queue_remove_from_head(&mpeg_queue, MPEG_NEED_DATA); |
2770 | queue_post(&mpeg_queue, MPEG_PREV, 0); | 2767 | queue_post(&mpeg_queue, MPEG_PREV, 0); |
2771 | #else /* SIMULATOR */ | 2768 | #else /* SIMULATOR */ |
2769 | char name_buf[MAX_PATH+1]; | ||
2772 | const char* file; | 2770 | const char* file; |
2773 | int steps = -1; | 2771 | int steps = -1; |
2774 | int index; | 2772 | int index; |
2775 | 2773 | ||
2776 | do { | 2774 | do { |
2777 | file = playlist_peek(steps); | 2775 | file = playlist_peek(steps, name_buf, sizeof(name_buf)); |
2778 | if(!file) | 2776 | if(!file) |
2779 | break; | 2777 | break; |
2780 | if(mp3info(&taginfo, file)) { | 2778 | if(mp3info(&taginfo, file)) { |