aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/VorbisDecoderPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-21 21:12:37 +0200
committerMax Kellermann <max@duempel.org>2013-10-21 21:12:37 +0200
commit82059645f18e4a8aa734e0a376d10bb52fc1cc7d (patch)
treee2d1c113c887cdafe95ec07419150d6b768211b6 /src/decoder/VorbisDecoderPlugin.cxx
parent13e9f18403b98f8123b1b983c4680957d684e47b (diff)
downloadmpd-82059645f18e4a8aa734e0a376d10bb52fc1cc7d.tar.gz
mpd-82059645f18e4a8aa734e0a376d10bb52fc1cc7d.tar.xz
mpd-82059645f18e4a8aa734e0a376d10bb52fc1cc7d.zip
decoder: rename the struct to "Decoder"
Diffstat (limited to 'src/decoder/VorbisDecoderPlugin.cxx')
-rw-r--r--src/decoder/VorbisDecoderPlugin.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/decoder/VorbisDecoderPlugin.cxx b/src/decoder/VorbisDecoderPlugin.cxx
index a7fbb9290..105ca018e 100644
--- a/src/decoder/VorbisDecoderPlugin.cxx
+++ b/src/decoder/VorbisDecoderPlugin.cxx
@@ -53,7 +53,7 @@
#include <unistd.h>
struct vorbis_input_stream {
- struct decoder *decoder;
+ Decoder *decoder;
struct input_stream *input_stream;
bool seekable;
@@ -76,7 +76,8 @@ static int ogg_seek_cb(void *data, ogg_int64_t offset, int whence)
Error error;
return vis->seekable &&
- (!vis->decoder || decoder_get_command(vis->decoder) != DecoderCommand::STOP) &&
+ (vis->decoder == nullptr ||
+ decoder_get_command(*vis->decoder) != DecoderCommand::STOP) &&
vis->input_stream->LockSeek(offset, whence, error)
? 0 : -1;
}
@@ -127,7 +128,7 @@ vorbis_strerror(int code)
static bool
vorbis_is_open(struct vorbis_input_stream *vis, OggVorbis_File *vf,
- struct decoder *decoder, struct input_stream *input_stream)
+ Decoder *decoder, struct input_stream *input_stream)
{
vis->decoder = decoder;
vis->input_stream = input_stream;
@@ -136,7 +137,7 @@ vorbis_is_open(struct vorbis_input_stream *vis, OggVorbis_File *vf,
int ret = ov_open_callbacks(vis, vf, NULL, 0, vorbis_is_callbacks);
if (ret < 0) {
if (decoder == NULL ||
- decoder_get_command(decoder) == DecoderCommand::NONE)
+ decoder_get_command(*decoder) == DecoderCommand::NONE)
FormatWarning(vorbis_domain,
"Failed to open Ogg Vorbis stream: %s",
vorbis_strerror(ret));
@@ -147,7 +148,7 @@ vorbis_is_open(struct vorbis_input_stream *vis, OggVorbis_File *vf,
}
static void
-vorbis_send_comments(struct decoder *decoder, struct input_stream *is,
+vorbis_send_comments(Decoder &decoder, struct input_stream *is,
char **comments)
{
Tag *tag = vorbis_comments_to_tag(comments);
@@ -175,10 +176,10 @@ vorbis_interleave(float *dest, const float *const*src,
/* public */
static void
-vorbis_stream_decode(struct decoder *decoder,
+vorbis_stream_decode(Decoder &decoder,
struct input_stream *input_stream)
{
- if (ogg_codec_detect(decoder, input_stream) != OGG_CODEC_VORBIS)
+ if (ogg_codec_detect(&decoder, input_stream) != OGG_CODEC_VORBIS)
return;
/* rewind the stream, because ogg_codec_detect() has
@@ -187,7 +188,7 @@ vorbis_stream_decode(struct decoder *decoder,
struct vorbis_input_stream vis;
OggVorbis_File vf;
- if (!vorbis_is_open(&vis, &vf, decoder, input_stream))
+ if (!vorbis_is_open(&vis, &vf, &decoder, input_stream))
return;
const vorbis_info *vi = ov_info(&vf, -1);