diff options
Diffstat (limited to 'streamer.c')
-rw-r--r-- | streamer.c | 47 |
1 files changed, 33 insertions, 14 deletions
@@ -1,19 +1,28 @@ /* - DeaDBeeF - ultimate music player for GNU/Linux systems with X11 - Copyright (C) 2009-2012 Alexey Yakovenko <waker@users.sourceforge.net> + This file is part of Deadbeef Player source code + http://deadbeef.sourceforge.net - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. + streamer implementation - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + Copyright (C) 2009-2012 Alexey Yakovenko - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Alexey Yakovenko waker@users.sourceforge.net */ #include <stdlib.h> #include <string.h> @@ -1144,7 +1153,7 @@ streamer_start_new_song (void) { if (fileinfo && memcmp (&orig_output_format, &fileinfo->fmt, sizeof (ddb_waveformat_t))) { memcpy (&output_format, &fileinfo->fmt, sizeof (ddb_waveformat_t)); memcpy (&orig_output_format, &fileinfo->fmt, sizeof (ddb_waveformat_t)); - fprintf (stderr, "streamer_set_output_format %dbit %s %dch %dHz channelmask=%X\n", output_format.bps, output_format.is_float ? "float" : "int", output_format.channels, output_format.samplerate, output_format.channelmask); +// fprintf (stderr, "streamer_set_output_format %dbit %s %dch %dHz channelmask=%X\n", output_format.bps, output_format.is_float ? "float" : "int", output_format.channels, output_format.samplerate, output_format.channelmask); streamer_set_output_format (); } if (0 != output->play ()) { @@ -1824,7 +1833,7 @@ streamer_set_output_format (void) { DB_output_t *output = plug_get_output (); int playing = (output->state () == OUTPUT_STATE_PLAYING); - fprintf (stderr, "streamer_set_output_format %dbit %s %dch %dHz channelmask=%X, bufferfill: %d\n", output_format.bps, output_format.is_float ? "float" : "int", output_format.channels, output_format.samplerate, output_format.channelmask, streamer_ringbuf.remaining); +// fprintf (stderr, "streamer_set_output_format %dbit %s %dch %dHz channelmask=%X, bufferfill: %d\n", output_format.bps, output_format.is_float ? "float" : "int", output_format.channels, output_format.samplerate, output_format.channelmask, streamer_ringbuf.remaining); ddb_waveformat_t fmt; memcpy (&fmt, &output_format, sizeof (ddb_waveformat_t)); if (autoconv_8_to_16) { @@ -2354,4 +2363,14 @@ audio_get_waveform_data (int type, float *data) { mutex_lock (audio_mem_mutex); memcpy (data, type == DDB_AUDIO_WAVEFORM ? audio_data : freq_data, sizeof (audio_data)); mutex_unlock (audio_mem_mutex); + +void +streamer_set_streamer_playlist (playlist_t *plt) { + if (streamer_playlist) { + plt_unref (streamer_playlist); + } + streamer_playlist = plt; + if (streamer_playlist) { + plt_ref (streamer_playlist); + } } |