Skip to content

Commit b431965

Browse files
authored
cdfs: fix createdvd CHD hashing for PS2/PSP RetroAchievements (#18955)
DVD-format CHDs created with `chdman createdvd` have no CD track metadata. The DVD metadata tag sets track type to "DVD" but leaves frames=0, causing chdstream_find_special_track to skip the track when selecting CHDSTREAM_TRACK_PRIMARY since 0 > 0 is false. Fix by immediately returning DVD tracks as the primary data track, since a createdvd CHD only ever has one track and it is always data. Fixes hash generation failed for PS2/PSP games stored as createdvd CHDs when using RetroAchievements. Closes #16145.
1 parent cf73f1a commit b431965

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

libretro-common/streams/chd_stream.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,13 @@ chdstream_find_special_track(chd_file *fd, int32_t track, metadata_t *meta)
320320
}
321321
break;
322322
case CHDSTREAM_TRACK_PRIMARY:
323+
/* DVD tracks have no frame count in metadata but are always
324+
* the primary data track - select immediately */
325+
if (strcmp(iter.type, "DVD") == 0)
326+
{
327+
*meta = iter;
328+
return true;
329+
}
323330
if (strcmp(iter.type, "AUDIO") && iter.frames > largest_size)
324331
{
325332
largest_size = iter.frames;

0 commit comments

Comments
 (0)