aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-11-11 21:33:10 +0100
committerMax Kellermann <max@duempel.org>2008-11-11 21:33:10 +0100
commit53c17db5e9184e26bd57356600f8fc259e94ca56 (patch)
tree96bd26881b31358f3f2b09f70664a6f4c9715eb9 /src
parent448ff32c96d269f3605c6ddcddf68a92c12679ba (diff)
downloadmpd-53c17db5e9184e26bd57356600f8fc259e94ca56.tar.gz
mpd-53c17db5e9184e26bd57356600f8fc259e94ca56.tar.xz
mpd-53c17db5e9184e26bd57356600f8fc259e94ca56.zip
ogg: use ogg_fopen() instead of ogg_open()
Move the reponsibility for freeing the file handle to libvorbis.
Diffstat (limited to 'src')
-rw-r--r--src/decoder/oggvorbis_plugin.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/decoder/oggvorbis_plugin.c b/src/decoder/oggvorbis_plugin.c
index 5aa777065..9fe381d25 100644
--- a/src/decoder/oggvorbis_plugin.c
+++ b/src/decoder/oggvorbis_plugin.c
@@ -327,17 +327,15 @@ oggvorbis_decode(struct decoder *decoder, struct input_stream *inStream)
static struct tag *oggvorbis_TagDup(const char *file)
{
+ char *duplicated;
+ int err;
struct tag *ret;
- FILE *fp;
OggVorbis_File vf;
- fp = fopen(file, "r");
- if (!fp) {
- return NULL;
- }
-
- if (ov_open(fp, &vf, NULL, 0) < 0) {
- fclose(fp);
+ duplicated = g_strdup(file);
+ err = ov_fopen(duplicated, &vf);
+ g_free(duplicated);
+ if (err < 0)
return NULL;
}