ogg: use ogg_fopen() instead of ogg_open()

Move the reponsibility for freeing the file handle to libvorbis.
This commit is contained in:
Max Kellermann 2008-11-11 21:33:10 +01:00
parent 448ff32c96
commit 53c17db5e9

View File

@ -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;
} }