Commit 53c17db5 authored by Max Kellermann's avatar Max Kellermann

ogg: use ogg_fopen() instead of ogg_open()

Move the reponsibility for freeing the file handle to libvorbis.
parent 448ff32c
...@@ -327,17 +327,15 @@ oggvorbis_decode(struct decoder *decoder, struct input_stream *inStream) ...@@ -327,17 +327,15 @@ oggvorbis_decode(struct decoder *decoder, struct input_stream *inStream)
static struct tag *oggvorbis_TagDup(const char *file) static struct tag *oggvorbis_TagDup(const char *file)
{ {
char *duplicated;
int err;
struct tag *ret; struct tag *ret;
FILE *fp;
OggVorbis_File vf; OggVorbis_File vf;
fp = fopen(file, "r"); duplicated = g_strdup(file);
if (!fp) { err = ov_fopen(duplicated, &vf);
return NULL; g_free(duplicated);
} if (err < 0)
if (ov_open(fp, &vf, NULL, 0) < 0) {
fclose(fp);
return NULL; return NULL;
} }
......
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