Mercurial > audlegacy
comparison audacious/playback.c @ 2128:a414866b32bc trunk
[svn] - bail after 15 failures to find an acceptable playback candidate
author | nenolod |
---|---|
date | Fri, 15 Dec 2006 10:48:13 -0800 |
parents | f18a5b617c34 |
children | 840263ee3a5c |
comparison
equal
deleted
inserted
replaced
2127:63af5b9c5026 | 2128:a414866b32bc |
---|---|
80 void | 80 void |
81 bmp_playback_initiate(void) | 81 bmp_playback_initiate(void) |
82 { | 82 { |
83 PlaylistEntry *entry = NULL; | 83 PlaylistEntry *entry = NULL; |
84 Playlist *playlist = playlist_get_active(); | 84 Playlist *playlist = playlist_get_active(); |
85 int penalty; | |
85 | 86 |
86 if (playlist_get_length(playlist) == 0) | 87 if (playlist_get_length(playlist) == 0) |
87 return; | 88 return; |
88 | 89 |
89 if (bmp_playback_get_playing()) | 90 if (bmp_playback_get_playing()) |
108 { | 109 { |
109 playlist_next(playlist); | 110 playlist_next(playlist); |
110 | 111 |
111 entry = playlist_get_entry_to_play(playlist); | 112 entry = playlist_get_entry_to_play(playlist); |
112 | 113 |
114 /* XXX ew. workaround for a stupid bug where audacious will keep | |
115 * trying to play a file with no valid decoder. | |
116 */ | |
113 if (entry == NULL) | 117 if (entry == NULL) |
114 return; | 118 return; |
119 | |
120 if (entry->decoder == NULL && | |
121 (entry->decoder = input_check_file(entry->filename, FALSE)) == NULL) | |
122 penalty++; | |
123 | |
124 /* if we hit 15 entries in a row with no valid decoder, just | |
125 * bail due to confusion | |
126 */ | |
127 if (penalty > 15) | |
128 return; | |
115 } | 129 } |
116 | 130 |
117 if (bmp_playback_get_time() != -1) { | 131 if (bmp_playback_get_time() != -1) { |
118 equalizerwin_load_auto_preset(entry->filename); | 132 equalizerwin_load_auto_preset(entry->filename); |
119 input_set_eq(cfg.equalizer_active, cfg.equalizer_preamp, | 133 input_set_eq(cfg.equalizer_active, cfg.equalizer_preamp, |