aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/oggvorbis_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-11-12 08:38:04 +0100
committerMax Kellermann <max@duempel.org>2008-11-12 08:38:04 +0100
commitef80464c0c30cffe9e507c45fd14d4a5da5406ae (patch)
tree77704fc09a66bd0a4246af74aa2f54990921cfd1 /src/decoder/oggvorbis_plugin.c
parentb67a8e4d6e532c465dca6b68de6cc8e378069c03 (diff)
downloadmpd-ef80464c0c30cffe9e507c45fd14d4a5da5406ae.tar.gz
mpd-ef80464c0c30cffe9e507c45fd14d4a5da5406ae.tar.xz
mpd-ef80464c0c30cffe9e507c45fd14d4a5da5406ae.zip
ogg: revert "use ogg_fopen() instead of ogg_open()"
Unfortunately, ov_fopen() is not supported by libvorbis versions older than 1.2.
Diffstat (limited to 'src/decoder/oggvorbis_plugin.c')
-rw-r--r--src/decoder/oggvorbis_plugin.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/decoder/oggvorbis_plugin.c b/src/decoder/oggvorbis_plugin.c
index f6be8562a..5aa777065 100644
--- a/src/decoder/oggvorbis_plugin.c
+++ b/src/decoder/oggvorbis_plugin.c
@@ -327,16 +327,19 @@ 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;
- duplicated = g_strdup(file);
- err = ov_fopen(duplicated, &vf);
- g_free(duplicated);
- if (err < 0)
+ fp = fopen(file, "r");
+ if (!fp) {
return NULL;
+ }
+
+ if (ov_open(fp, &vf, NULL, 0) < 0) {
+ fclose(fp);
+ return NULL;
+ }
ret = oggCommentsParse(ov_comment(&vf, -1)->user_comments);