ogg: revert "use ogg_fopen() instead of ogg_open()"

Unfortunately, ov_fopen() is not supported by libvorbis versions older
than 1.2.
This commit is contained in:
Max Kellermann 2008-11-12 08:38:04 +01:00
parent b67a8e4d6e
commit ef80464c0c

View File

@ -327,16 +327,19 @@ 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;
duplicated = g_strdup(file); fp = fopen(file, "r");
err = ov_fopen(duplicated, &vf); if (!fp) {
g_free(duplicated);
if (err < 0)
return NULL; return NULL;
}
if (ov_open(fp, &vf, NULL, 0) < 0) {
fclose(fp);
return NULL;
}
ret = oggCommentsParse(ov_comment(&vf, -1)->user_comments); ret = oggCommentsParse(ov_comment(&vf, -1)->user_comments);