From 7061cb14fb0af8dc049721400be175a22cc733d6 Mon Sep 17 00:00:00 2001 From: Brian Koropoff Date: Sun, 17 Sep 2017 14:22:37 -0700 Subject: [PATCH] chd_stream: support CHDs from GDI files --- libretro-common/streams/chd_stream.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/libretro-common/streams/chd_stream.c b/libretro-common/streams/chd_stream.c index 0704e1b5a9..adce6d71d4 100644 --- a/libretro-common/streams/chd_stream.c +++ b/libretro-common/streams/chd_stream.c @@ -103,8 +103,19 @@ chdstream_get_meta(chd_file *chd, int idx, metadata_t *md) sizeof(meta), &meta_size, NULL, NULL); if (err == CHDERR_NONE) { - sscanf(meta, CDROM_TRACK_METADATA_FORMAT, - &md->track, md->type, md->subtype, &md->frames); + sscanf(meta, CDROM_TRACK_METADATA_FORMAT, &md->track, md->type, + md->subtype, &md->frames); + md->extra = padding_frames(md->frames); + return true; + } + + err = chd_get_metadata(chd, GDROM_TRACK_METADATA_TAG, idx, meta, + sizeof(meta), &meta_size, NULL, NULL); + if (err == CHDERR_NONE) + { + sscanf(meta, GDROM_TRACK_METADATA_FORMAT, &md->track, md->type, + md->subtype, &md->frames, &md->pad, &md->pregap, md->pgtype, + md->pgsub, &md->postgap); md->extra = padding_frames(md->frames); return true; }