2
* mpc123 - Musepack Console audio player
3
* Copyright (C) 2005 Fernando Vezzosi <fvezzosi at masobit.net>
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software Foundation,
17
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28
* select which mpc_reader to use, based on filename
29
* currently it knows about:
32
int reader_choose_and_prepare(const char * fname, mpc_reader ** ret,
34
/* default to plain file reader */
35
debugf("choosing plain file reader for \"%s\"", fname);
36
data->fd=open(fname, O_RDONLY);
38
dief("Couldn't open file \"%s\": [%d] %s",
39
fname, errno, (errno == 0 ? "Unknown reason" : strerror(errno) ));
41
*ret=&mpc123_file_reader;
47
* cleans up things needed for each reader
51
void do_cleanup_stream(mpc_reader * the_reader, reader_data * the_data){
56
if(the_reader == &mpc123_file_reader){