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)
{
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;
}