Fix some layered/segmented metas showing wrong codec

This commit is contained in:
bnnm 2020-02-22 10:09:20 +01:00
parent 8868bf085e
commit 7a3b1021ee

View File

@ -1275,16 +1275,20 @@ void get_vgmstream_coding_description(VGMSTREAM *vgmstream, char *out, size_t ou
int i, list_length; int i, list_length;
const char *description; const char *description;
/* we need to recurse down because of FFmpeg */ #ifdef VGM_USE_FFMPEG
if (vgmstream->layout_type == layout_layered) { if (vgmstream->coding_type == coding_FFmpeg) {
layered_layout_data* layout_data = vgmstream->layout_data; /* recurse down for FFmpeg, but metas should set prefered/main codec, or maybe print a list of codecs */
get_vgmstream_coding_description(layout_data->layers[0], out, out_size); if (vgmstream->layout_type == layout_layered) {
return; layered_layout_data* layout_data = vgmstream->layout_data;
} else if (vgmstream->layout_type == layout_segmented) { get_vgmstream_coding_description(layout_data->layers[0], out, out_size);
segmented_layout_data* layout_data = vgmstream->layout_data; return;
get_vgmstream_coding_description(layout_data->segments[0], out, out_size); } else if (vgmstream->layout_type == layout_segmented) {
return; segmented_layout_data* layout_data = vgmstream->layout_data;
get_vgmstream_coding_description(layout_data->segments[0], out, out_size);
return;
}
} }
#endif
description = "CANNOT DECODE"; description = "CANNOT DECODE";