diff options
-rw-r--r-- | apps/playlist.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/apps/playlist.c b/apps/playlist.c index 7942bac1ca..a63d974a7f 100644 --- a/apps/playlist.c +++ b/apps/playlist.c | |||
@@ -785,7 +785,8 @@ static int add_directory_to_playlist(struct playlist_info* playlist, | |||
785 | display_playlist_count(*count, count_str); | 785 | display_playlist_count(*count, count_str); |
786 | 786 | ||
787 | if (*count == PLAYLIST_DISPLAY_COUNT && | 787 | if (*count == PLAYLIST_DISPLAY_COUNT && |
788 | (audio_status() & AUDIO_STATUS_PLAY)) | 788 | (audio_status() & AUDIO_STATUS_PLAY) && |
789 | playlist->started) | ||
789 | audio_flush_and_reload_tracks(); | 790 | audio_flush_and_reload_tracks(); |
790 | } | 791 | } |
791 | 792 | ||
@@ -2796,7 +2797,7 @@ int playlist_insert_track(struct playlist_info* playlist, | |||
2796 | if (result != -1) | 2797 | if (result != -1) |
2797 | { | 2798 | { |
2798 | sync_control(playlist, false); | 2799 | sync_control(playlist, false); |
2799 | if (audio_status() & AUDIO_STATUS_PLAY) | 2800 | if ((audio_status() & AUDIO_STATUS_PLAY) && playlist->started) |
2800 | audio_flush_and_reload_tracks(); | 2801 | audio_flush_and_reload_tracks(); |
2801 | } | 2802 | } |
2802 | 2803 | ||
@@ -2841,7 +2842,7 @@ int playlist_insert_directory(struct playlist_info* playlist, | |||
2841 | 2842 | ||
2842 | display_playlist_count(count, count_str); | 2843 | display_playlist_count(count, count_str); |
2843 | 2844 | ||
2844 | if (audio_status() & AUDIO_STATUS_PLAY) | 2845 | if ((audio_status() & AUDIO_STATUS_PLAY) && playlist->started) |
2845 | audio_flush_and_reload_tracks(); | 2846 | audio_flush_and_reload_tracks(); |
2846 | 2847 | ||
2847 | #ifdef HAVE_DIRCACHE | 2848 | #ifdef HAVE_DIRCACHE |
@@ -2939,7 +2940,8 @@ int playlist_insert_playlist(struct playlist_info* playlist, char *filename, | |||
2939 | display_playlist_count(count, count_str); | 2940 | display_playlist_count(count, count_str); |
2940 | 2941 | ||
2941 | if (count == PLAYLIST_DISPLAY_COUNT && | 2942 | if (count == PLAYLIST_DISPLAY_COUNT && |
2942 | (audio_status() & AUDIO_STATUS_PLAY)) | 2943 | (audio_status() & AUDIO_STATUS_PLAY) && |
2944 | playlist->started) | ||
2943 | audio_flush_and_reload_tracks(); | 2945 | audio_flush_and_reload_tracks(); |
2944 | } | 2946 | } |
2945 | } | 2947 | } |
@@ -2957,7 +2959,7 @@ int playlist_insert_playlist(struct playlist_info* playlist, char *filename, | |||
2957 | 2959 | ||
2958 | display_playlist_count(count, count_str); | 2960 | display_playlist_count(count, count_str); |
2959 | 2961 | ||
2960 | if (audio_status() & AUDIO_STATUS_PLAY) | 2962 | if ((audio_status() & AUDIO_STATUS_PLAY) && playlist->started) |
2961 | audio_flush_and_reload_tracks(); | 2963 | audio_flush_and_reload_tracks(); |
2962 | 2964 | ||
2963 | #ifdef HAVE_DIRCACHE | 2965 | #ifdef HAVE_DIRCACHE |
@@ -2989,7 +2991,8 @@ int playlist_delete(struct playlist_info* playlist, int index) | |||
2989 | 2991 | ||
2990 | result = remove_track_from_playlist(playlist, index, true); | 2992 | result = remove_track_from_playlist(playlist, index, true); |
2991 | 2993 | ||
2992 | if (result != -1 && (audio_status() & AUDIO_STATUS_PLAY)) | 2994 | if (result != -1 && (audio_status() & AUDIO_STATUS_PLAY) && |
2995 | playlist->started) | ||
2993 | audio_flush_and_reload_tracks(); | 2996 | audio_flush_and_reload_tracks(); |
2994 | 2997 | ||
2995 | return result; | 2998 | return result; |
@@ -3077,7 +3080,7 @@ int playlist_move(struct playlist_info* playlist, int index, int new_index) | |||
3077 | } | 3080 | } |
3078 | } | 3081 | } |
3079 | 3082 | ||
3080 | if (audio_status() & AUDIO_STATUS_PLAY) | 3083 | if ((audio_status() & AUDIO_STATUS_PLAY) && playlist->started) |
3081 | audio_flush_and_reload_tracks(); | 3084 | audio_flush_and_reload_tracks(); |
3082 | } | 3085 | } |
3083 | } | 3086 | } |
@@ -3102,7 +3105,8 @@ int playlist_randomise(struct playlist_info* playlist, unsigned int seed, | |||
3102 | 3105 | ||
3103 | result = randomise_playlist(playlist, seed, start_current, true); | 3106 | result = randomise_playlist(playlist, seed, start_current, true); |
3104 | 3107 | ||
3105 | if (result != -1 && (audio_status() & AUDIO_STATUS_PLAY)) | 3108 | if (result != -1 && (audio_status() & AUDIO_STATUS_PLAY) && |
3109 | playlist->started) | ||
3106 | audio_flush_and_reload_tracks(); | 3110 | audio_flush_and_reload_tracks(); |
3107 | 3111 | ||
3108 | return result; | 3112 | return result; |
@@ -3120,7 +3124,8 @@ int playlist_sort(struct playlist_info* playlist, bool start_current) | |||
3120 | 3124 | ||
3121 | result = sort_playlist(playlist, start_current, true); | 3125 | result = sort_playlist(playlist, start_current, true); |
3122 | 3126 | ||
3123 | if (result != -1 && (audio_status() & AUDIO_STATUS_PLAY)) | 3127 | if (result != -1 && (audio_status() & AUDIO_STATUS_PLAY) && |
3128 | playlist->started) | ||
3124 | audio_flush_and_reload_tracks(); | 3129 | audio_flush_and_reload_tracks(); |
3125 | 3130 | ||
3126 | return result; | 3131 | return result; |