Add stream name string, for metas than can use it

This commit is contained in:
bnnm 2017-08-12 11:27:10 +02:00
parent a3146ed2f6
commit b7c807a85c
2 changed files with 23 additions and 2 deletions

View File

@ -446,6 +446,9 @@ VGMSTREAM * init_vgmstream_internal(STREAMFILE *streamFile, int do_dfs) {
} }
#endif #endif
/* save info */
vgmstream->stream_index = streamFile->stream_index;
/* save start things so we can restart for seeking */ /* save start things so we can restart for seeking */
/* copy the channels */ /* copy the channels */
memcpy(vgmstream->start_ch,vgmstream->ch,sizeof(VGMSTREAMCHANNEL)*vgmstream->channels); memcpy(vgmstream->start_ch,vgmstream->ch,sizeof(VGMSTREAMCHANNEL)*vgmstream->channels);
@ -2052,10 +2055,23 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
/* only interesting if more than one */ /* only interesting if more than one */
if (vgmstream->num_streams > 1) { if (vgmstream->num_streams > 1) {
snprintf(temp,TEMPSIZE, snprintf(temp,TEMPSIZE,
"\nnumber of streams: %d", "\nstream number: %d",
vgmstream->num_streams); vgmstream->num_streams);
concatn(length,desc,temp); concatn(length,desc,temp);
} }
if (vgmstream->num_streams > 1 && vgmstream->stream_index > 0) {
snprintf(temp,TEMPSIZE,
"\nstream index: %d",
vgmstream->stream_index);
concatn(length,desc,temp);
}
if (vgmstream->stream_name[0] != '\0') {
snprintf(temp,TEMPSIZE,
"\nstream name: %s",
vgmstream->stream_name);
concatn(length,desc,temp);
}
} }
/* filename search pairs for dual file stereo */ /* filename search pairs for dual file stereo */

View File

@ -6,6 +6,7 @@
#define _VGMSTREAM_H #define _VGMSTREAM_H
enum { PATH_LIMIT = 32768 }; enum { PATH_LIMIT = 32768 };
enum { STREAM_NAME_SIZE = 255 }; /* reasonable max */
#include "streamfile.h" #include "streamfile.h"
@ -698,7 +699,11 @@ typedef struct {
coding_t coding_type; /* type of encoding */ coding_t coding_type; /* type of encoding */
layout_t layout_type; /* type of layout for data */ layout_t layout_type; /* type of layout for data */
meta_t meta_type; /* how we know the metadata */ meta_t meta_type; /* how we know the metadata */
int num_streams; /* info only, for a few multi-stream formats (0=not set/one, 1=one stream) */
/* streams (info only) */
int num_streams; /* for multi-stream formats (0=not set/one, 1=one stream) */
int stream_index; /* current stream */
char stream_name[STREAM_NAME_SIZE]; /* name of the current stream, if the file stores it and it's filled */
/* looping */ /* looping */
int loop_flag; /* is this stream looped? */ int loop_flag; /* is this stream looped? */