Mercurial > audlegacy-plugins
comparison src/crossfade/crossfade.c @ 3144:de2f796d6f04
crossfade: fix preprocessor conditional compilation
author | Michal Lipski <tallica@o2.pl> |
---|---|
date | Sat, 09 May 2009 18:06:58 +0200 |
parents | 40e5d243971e |
children |
comparison
equal
deleted
inserted
replaced
3143:40e5d243971e | 3144:de2f796d6f04 |
---|---|
1850 DEBUG(("[crossfade] close: WARNING: not opened!\n")); | 1850 DEBUG(("[crossfade] close: WARNING: not opened!\n")); |
1851 MUTEX_UNLOCK(&buffer_mutex); | 1851 MUTEX_UNLOCK(&buffer_mutex); |
1852 return; | 1852 return; |
1853 } | 1853 } |
1854 | 1854 |
1855 #if defined(COMPILE_FOR_AUDACIOUS) && AUDACIOUS_ABI_VERSION >= 2 | |
1856 /* HACK: to distinguish between STOP and EOP, check Audacious' | 1855 /* HACK: to distinguish between STOP and EOP, check Audacious' |
1857 input_playing() variable. It seems to be TRUE at this point | 1856 input_playing() variable. It seems to be TRUE at this point |
1858 only when the end of the playlist is reached. | 1857 only when the end of the playlist is reached. |
1859 | 1858 |
1860 Normally, 'playing' is constantly being updated in the | 1859 Normally, 'playing' is constantly being updated in the |
1862 to use it. Therefore, we can set 'playing' to FALSE here, | 1861 to use it. Therefore, we can set 'playing' to FALSE here, |
1863 which later 'buffer_thread' will interpret as EOP (see above). | 1862 which later 'buffer_thread' will interpret as EOP (see above). |
1864 */ | 1863 */ |
1865 if (xfplayer_input_playing()) | 1864 if (xfplayer_input_playing()) |
1866 playing = FALSE; | 1865 playing = FALSE; |
1867 #else | |
1868 /* HACK: use patched XMMS 'input_stopped_for_restart' */ | |
1869 if (input_stopped_for_restart && *input_stopped_for_restart) | |
1870 { | |
1871 DEBUG(("[crossfade] close: playback will restart soon\n")); | |
1872 output_restart = TRUE; | |
1873 } | |
1874 else | |
1875 output_restart = FALSE; | |
1876 #endif | |
1877 | 1866 |
1878 if (playing) | 1867 if (playing) |
1879 { | 1868 { |
1880 /* immediatelly close output when paused */ | 1869 /* immediatelly close output when paused */ |
1881 if (paused) | 1870 if (paused) |
2040 file = xfplaylist_get_filename(pos); | 2029 file = xfplaylist_get_filename(pos); |
2041 | 2030 |
2042 if (!file) | 2031 if (!file) |
2043 file = g_strdup(xfplaylist_get_songtitle(pos)); | 2032 file = g_strdup(xfplaylist_get_songtitle(pos)); |
2044 | 2033 |
2045 #if defined(COMPILE_FOR_AUDACIOUS) | |
2046 /* HACK: special handling for audacious, which just calls flush(0) on a songchange */ | 2034 /* HACK: special handling for audacious, which just calls flush(0) on a songchange */ |
2047 if (file && last_filename && strcmp(file, last_filename) != 0) | 2035 if (file && last_filename && strcmp(file, last_filename) != 0) |
2048 { | 2036 { |
2049 DEBUG(("[crossfade] flush: filename changed, forcing close/reopen...\n")); | 2037 DEBUG(("[crossfade] flush: filename changed, forcing close/reopen...\n")); |
2050 xfade_close_audio(); | 2038 xfade_close_audio(); |
2053 fade_config = &config->fc[FADE_CONFIG_XFADE]; | 2041 fade_config = &config->fc[FADE_CONFIG_XFADE]; |
2054 xfade_open_audio(in_format.fmt, in_format.rate, in_format.nch); | 2042 xfade_open_audio(in_format.fmt, in_format.rate, in_format.nch); |
2055 DEBUG(("[crossfade] flush: filename changed, forcing close/reopen... done\n")); | 2043 DEBUG(("[crossfade] flush: filename changed, forcing close/reopen... done\n")); |
2056 return; | 2044 return; |
2057 } | 2045 } |
2058 #endif | |
2059 | 2046 |
2060 /* lock buffer */ | 2047 /* lock buffer */ |
2061 MUTEX_LOCK(&buffer_mutex); | 2048 MUTEX_LOCK(&buffer_mutex); |
2062 | 2049 |
2063 /* update streampos with new stream position (input format size) */ | 2050 /* update streampos with new stream position (input format size) */ |