Commit dd33317f authored by Max Kellermann's avatar Max Kellermann

input_stream: move input_stream_init(), _deinit() to _internal.c

parent c344d63f
......@@ -658,6 +658,7 @@ INPUT_SRC = \
src/input_init.c \
src/input_registry.c \
src/input_stream.c \
src/input_internal.c src/input_internal.h \
src/input/rewind_input_plugin.c \
src/input/file_input_plugin.c
......
......@@ -24,6 +24,7 @@
#include "config.h"
#include "archive/bz2_archive_plugin.h"
#include "archive_api.h"
#include "input_internal.h"
#include "input_plugin.h"
#include "refcount.h"
......
......@@ -24,6 +24,7 @@
#include "config.h"
#include "archive/iso9660_archive_plugin.h"
#include "archive_api.h"
#include "input_internal.h"
#include "input_plugin.h"
#include "refcount.h"
......
......@@ -25,6 +25,7 @@
#include "archive/zzip_archive_plugin.h"
#include "archive_api.h"
#include "archive_api.h"
#include "input_internal.h"
#include "input_plugin.h"
#include "refcount.h"
......
......@@ -23,6 +23,7 @@
#include "config.h"
#include "input/cdio_paranoia_input_plugin.h"
#include "input_internal.h"
#include "input_plugin.h"
#include "refcount.h"
#include "pcm_buffer.h"
......
......@@ -19,6 +19,7 @@
#include "config.h"
#include "input/curl_input_plugin.h"
#include "input_internal.h"
#include "input_plugin.h"
#include "conf.h"
#include "tag.h"
......
......@@ -19,6 +19,7 @@
#include "config.h"
#include "input/despotify_input_plugin.h"
#include "input_internal.h"
#include "input_plugin.h"
#include "tag.h"
#include "despotify_utils.h"
......
......@@ -19,6 +19,7 @@
#include "config.h"
#include "input/ffmpeg_input_plugin.h"
#include "input_internal.h"
#include "input_plugin.h"
#include <libavformat/avio.h>
......
......@@ -19,6 +19,7 @@
#include "config.h" /* must be first for large file support */
#include "input/file_input_plugin.h"
#include "input_internal.h"
#include "input_plugin.h"
#include "fd_util.h"
#include "open.h"
......
......@@ -19,6 +19,7 @@
#include "config.h"
#include "input/mms_input_plugin.h"
#include "input_internal.h"
#include "input_plugin.h"
#include <glib.h>
......
......@@ -19,6 +19,7 @@
#include "config.h"
#include "input/rewind_input_plugin.h"
#include "input_internal.h"
#include "input_plugin.h"
#include "tag.h"
......
......@@ -19,6 +19,7 @@
#include "config.h"
#include "input/soup_input_plugin.h"
#include "input_internal.h"
#include "input_plugin.h"
#include "io_thread.h"
#include "conf.h"
......
/*
* Copyright (C) 2003-2011 The Music Player Daemon Project
* http://www.musicpd.org
*
* 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.
*
* 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.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "input_internal.h"
#include "input_stream.h"
void
input_stream_init(struct input_stream *is, const struct input_plugin *plugin,
const char *uri)
{
is->plugin = plugin;
is->uri = g_strdup(uri);
is->ready = false;
is->seekable = false;
is->size = -1;
is->offset = 0;
is->mime = NULL;
}
void
input_stream_deinit(struct input_stream *is)
{
g_free(is->uri);
g_free(is->mime);
}
/*
* Copyright (C) 2003-2011 The Music Player Daemon Project
* http://www.musicpd.org
*
* 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.
*
* 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.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_INPUT_INTERNAL_H
#define MPD_INPUT_INTERNAL_H
#include "check.h"
struct input_stream;
struct input_plugin;
void
input_stream_init(struct input_stream *is, const struct input_plugin *plugin,
const char *uri);
void
input_stream_deinit(struct input_stream *is);
#endif
......@@ -71,26 +71,6 @@ struct input_stream {
char *mime;
};
static inline void
input_stream_init(struct input_stream *is, const struct input_plugin *plugin,
const char *uri)
{
is->plugin = plugin;
is->uri = g_strdup(uri);
is->ready = false;
is->seekable = false;
is->size = -1;
is->offset = 0;
is->mime = NULL;
}
static inline void
input_stream_deinit(struct input_stream *is)
{
g_free(is->uri);
g_free(is->mime);
}
/**
* Opens a new input stream. You may not access it until the "ready"
* flag is set.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment