mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-24 06:50:20 +01:00
Remove get_realname from streamfiles as it's not used anymore
It was implemented for Audacious only to open companion NWA files, but current version has no need for it. In case there is some obscure thing that needs it, Audacious's vfs.cc should translate or return realnames transparently, without having to modify other streamfiles.
This commit is contained in:
parent
3d2f7e0de2
commit
46f333cc8e
@ -11,8 +11,8 @@ typedef struct _VFSSTREAMFILE {
|
||||
STREAMFILE sf;
|
||||
VFSFile *vfsFile;
|
||||
off_t offset;
|
||||
char name[260];
|
||||
char realname[260];
|
||||
char name[32768];
|
||||
//char realname[32768];
|
||||
} VFSSTREAMFILE;
|
||||
|
||||
static STREAMFILE *open_vfs_by_VFSFILE(VFSFile *file, const char *path);
|
||||
@ -53,12 +53,6 @@ static void get_name_vfs(VFSSTREAMFILE *streamfile, char *buffer,
|
||||
buffer[length - 1] = '\0';
|
||||
}
|
||||
|
||||
static void get_realname_vfs(VFSSTREAMFILE *streamfile, char *buffer,
|
||||
size_t length) {
|
||||
strncpy(buffer, streamfile->realname, length);
|
||||
buffer[length - 1] = '\0';
|
||||
}
|
||||
|
||||
static STREAMFILE *open_vfs_impl(VFSSTREAMFILE *streamfile,
|
||||
const char *const filename,
|
||||
size_t buffersize) {
|
||||
@ -80,7 +74,6 @@ STREAMFILE *open_vfs_by_VFSFILE(VFSFile *file, const char *path) {
|
||||
streamfile->sf.get_size = get_size_vfs;
|
||||
streamfile->sf.get_offset = get_offset_vfs;
|
||||
streamfile->sf.get_name = get_name_vfs;
|
||||
streamfile->sf.get_realname = get_realname_vfs;
|
||||
streamfile->sf.open = open_vfs_impl;
|
||||
streamfile->sf.close = close_vfs;
|
||||
|
||||
@ -88,12 +81,16 @@ STREAMFILE *open_vfs_by_VFSFILE(VFSFile *file, const char *path) {
|
||||
streamfile->offset = 0;
|
||||
strncpy(streamfile->name, path, sizeof(streamfile->name));
|
||||
streamfile->name[sizeof(streamfile->name) - 1] = '\0';
|
||||
{
|
||||
gchar *realname = g_filename_from_uri(path, NULL, NULL);
|
||||
strncpy(streamfile->realname, realname, sizeof(streamfile->realname));
|
||||
streamfile->realname[sizeof(streamfile->realname) - 1] = '\0';
|
||||
g_free(realname);
|
||||
}
|
||||
|
||||
// for reference, actual file path ("name" has protocol path, file://...).
|
||||
// name should work for all situations but in case it's needed again maybe
|
||||
// get_name should always return realname, as it's used to open companion VFSFiles
|
||||
//{
|
||||
// gchar *realname = g_filename_from_uri(path, NULL, NULL);
|
||||
// strncpy(streamfile->realname, realname, sizeof(streamfile->realname));
|
||||
// streamfile->realname[sizeof(streamfile->realname) - 1] = '\0';
|
||||
// g_free(realname);
|
||||
//}
|
||||
|
||||
return &streamfile->sf;
|
||||
}
|
||||
|
@ -230,7 +230,6 @@ static STREAMFILE * open_foo_streamfile_buffer_by_file(service_ptr_t<file> m_fil
|
||||
streamfile->sf.get_size = (size_t (__cdecl *)(_STREAMFILE *)) get_size_foo;
|
||||
streamfile->sf.get_offset = (off_t (__cdecl *)(_STREAMFILE *)) get_offset_foo;
|
||||
streamfile->sf.get_name = (void (__cdecl *)(_STREAMFILE *,char *,size_t)) get_name_foo;
|
||||
streamfile->sf.get_realname = (void (__cdecl *)(_STREAMFILE *,char *,size_t)) get_name_foo;
|
||||
streamfile->sf.open = (_STREAMFILE *(__cdecl *)(_STREAMFILE *,const char *const ,size_t)) open_foo;
|
||||
streamfile->sf.close = (void (__cdecl *)(_STREAMFILE *)) close_foo;
|
||||
|
||||
|
@ -148,7 +148,6 @@ static STREAMFILE *open_aix_impl(AIXSTREAMFILE *streamfile,const char * const fi
|
||||
streamfile->sf.get_size = (void*)get_size_aix;
|
||||
streamfile->sf.get_offset = (void*)get_offset_aix;
|
||||
streamfile->sf.get_name = (void*)get_name_aix;
|
||||
streamfile->sf.get_realname = (void*)get_name_aix;
|
||||
streamfile->sf.open = (void*)open_aix_impl;
|
||||
streamfile->sf.close = (void*)close_aix;
|
||||
|
||||
|
@ -41,11 +41,7 @@ static size_t get_offset_bar(BARSTREAMFILE *streamFile) {
|
||||
}
|
||||
|
||||
static void get_name_bar(BARSTREAMFILE *streamFile, char *name, size_t length) {
|
||||
return streamFile->real_file->get_name(streamFile->real_file, name, length);
|
||||
}
|
||||
|
||||
static void get_realname_bar(BARSTREAMFILE *streamFile, char *name, size_t length) {
|
||||
return streamFile->real_file->get_realname(streamFile->real_file, name, length);
|
||||
streamFile->real_file->get_name(streamFile->real_file, name, length);
|
||||
}
|
||||
|
||||
STREAMFILE *open_bar(BARSTREAMFILE *streamFile, const char * const filename, size_t buffersize) {
|
||||
@ -75,7 +71,6 @@ static void close_bar(BARSTREAMFILE *streamFile) {
|
||||
streamfile->sf.get_size = (void*)get_size_bar;
|
||||
streamfile->sf.get_offset = (void*)get_offset_bar;
|
||||
streamfile->sf.get_name = (void*)get_name_bar;
|
||||
streamfile->sf.get_realname = (void*)get_realname_bar;
|
||||
streamfile->sf.open = (void*)open_bar;
|
||||
streamfile->sf.close = (void*)close_bar;
|
||||
|
||||
|
@ -161,7 +161,6 @@ static STREAMFILE * open_stdio_streamfile_buffer_by_file(FILE *infile,const char
|
||||
streamfile->sf.get_size = (void*)get_size_stdio;
|
||||
streamfile->sf.get_offset = (void*)get_offset_stdio;
|
||||
streamfile->sf.get_name = (void*)get_name_stdio;
|
||||
streamfile->sf.get_realname = (void*)get_name_stdio;
|
||||
streamfile->sf.open = (void*)open_stdio;
|
||||
streamfile->sf.close = (void*)close_stdio;
|
||||
|
||||
@ -296,9 +295,6 @@ static size_t buffer_get_offset(BUFFER_STREAMFILE * streamfile) {
|
||||
static void buffer_get_name(BUFFER_STREAMFILE *streamfile, char *buffer, size_t length) {
|
||||
streamfile->inner_sf->get_name(streamfile->inner_sf, buffer, length); /* default */
|
||||
}
|
||||
static void buffer_get_realname(BUFFER_STREAMFILE *streamfile, char *buffer, size_t length) {
|
||||
streamfile->inner_sf->get_realname(streamfile->inner_sf, buffer, length); /* default */
|
||||
}
|
||||
static STREAMFILE *buffer_open(BUFFER_STREAMFILE *streamfile, const char * const filename, size_t buffersize) {
|
||||
STREAMFILE *new_inner_sf = streamfile->inner_sf->open(streamfile->inner_sf,filename,buffersize);
|
||||
return open_buffer_streamfile(new_inner_sf, buffersize); /* original buffer size is preferable? */
|
||||
@ -329,7 +325,6 @@ STREAMFILE *open_buffer_streamfile(STREAMFILE *streamfile, size_t buffer_size) {
|
||||
this_sf->sf.get_size = (void*)buffer_get_size;
|
||||
this_sf->sf.get_offset = (void*)buffer_get_offset;
|
||||
this_sf->sf.get_name = (void*)buffer_get_name;
|
||||
this_sf->sf.get_realname = (void*)buffer_get_realname;
|
||||
this_sf->sf.open = (void*)buffer_open;
|
||||
this_sf->sf.close = (void*)buffer_close;
|
||||
this_sf->sf.stream_index = streamfile->stream_index;
|
||||
@ -370,9 +365,6 @@ static size_t wrap_get_offset(WRAP_STREAMFILE * streamfile) {
|
||||
static void wrap_get_name(WRAP_STREAMFILE *streamfile, char *buffer, size_t length) {
|
||||
streamfile->inner_sf->get_name(streamfile->inner_sf, buffer, length); /* default */
|
||||
}
|
||||
static void wrap_get_realname(WRAP_STREAMFILE *streamfile, char *buffer, size_t length) {
|
||||
streamfile->inner_sf->get_realname(streamfile->inner_sf, buffer, length); /* default */
|
||||
}
|
||||
static void wrap_open(WRAP_STREAMFILE *streamfile, const char * const filename, size_t buffersize) {
|
||||
streamfile->inner_sf->open(streamfile->inner_sf, filename, buffersize); /* default (don't wrap) */
|
||||
}
|
||||
@ -394,7 +386,6 @@ STREAMFILE *open_wrap_streamfile(STREAMFILE *streamfile) {
|
||||
this_sf->sf.get_size = (void*)wrap_get_size;
|
||||
this_sf->sf.get_offset = (void*)wrap_get_offset;
|
||||
this_sf->sf.get_name = (void*)wrap_get_name;
|
||||
this_sf->sf.get_realname = (void*)wrap_get_realname;
|
||||
this_sf->sf.open = (void*)wrap_open;
|
||||
this_sf->sf.close = (void*)wrap_close;
|
||||
this_sf->sf.stream_index = streamfile->stream_index;
|
||||
@ -428,9 +419,6 @@ static off_t clamp_get_offset(CLAMP_STREAMFILE *streamfile) {
|
||||
static void clamp_get_name(CLAMP_STREAMFILE *streamfile, char *buffer, size_t length) {
|
||||
streamfile->inner_sf->get_name(streamfile->inner_sf, buffer, length); /* default */
|
||||
}
|
||||
static void clamp_get_realname(CLAMP_STREAMFILE *streamfile, char *buffer, size_t length) {
|
||||
streamfile->inner_sf->get_realname(streamfile->inner_sf, buffer, length); /* default */
|
||||
}
|
||||
static STREAMFILE *clamp_open(CLAMP_STREAMFILE *streamfile, const char * const filename, size_t buffersize) {
|
||||
char original_filename[PATH_LIMIT];
|
||||
STREAMFILE *new_inner_sf;
|
||||
@ -464,7 +452,6 @@ STREAMFILE *open_clamp_streamfile(STREAMFILE *streamfile, off_t start, size_t si
|
||||
this_sf->sf.get_size = (void*)clamp_get_size;
|
||||
this_sf->sf.get_offset = (void*)clamp_get_offset;
|
||||
this_sf->sf.get_name = (void*)clamp_get_name;
|
||||
this_sf->sf.get_realname = (void*)clamp_get_realname;
|
||||
this_sf->sf.open = (void*)clamp_open;
|
||||
this_sf->sf.close = (void*)clamp_close;
|
||||
this_sf->sf.stream_index = streamfile->stream_index;
|
||||
@ -505,9 +492,6 @@ static off_t io_get_offset(IO_STREAMFILE *streamfile) {
|
||||
static void io_get_name(IO_STREAMFILE *streamfile, char *buffer, size_t length) {
|
||||
streamfile->inner_sf->get_name(streamfile->inner_sf, buffer, length); /* default */
|
||||
}
|
||||
static void io_get_realname(IO_STREAMFILE *streamfile, char *buffer, size_t length) {
|
||||
streamfile->inner_sf->get_realname(streamfile->inner_sf, buffer, length); /* default */
|
||||
}
|
||||
static STREAMFILE *io_open(IO_STREAMFILE *streamfile, const char * const filename, size_t buffersize) {
|
||||
//todo should have some flag to decide if opening other files with IO
|
||||
STREAMFILE *new_inner_sf = streamfile->inner_sf->open(streamfile->inner_sf,filename,buffersize);
|
||||
@ -533,7 +517,6 @@ STREAMFILE *open_io_streamfile(STREAMFILE *streamfile, void* data, size_t data_s
|
||||
this_sf->sf.get_size = (void*)io_get_size;
|
||||
this_sf->sf.get_offset = (void*)io_get_offset;
|
||||
this_sf->sf.get_name = (void*)io_get_name;
|
||||
this_sf->sf.get_realname = (void*)io_get_realname;
|
||||
this_sf->sf.open = (void*)io_open;
|
||||
this_sf->sf.close = (void*)io_close;
|
||||
this_sf->sf.stream_index = streamfile->stream_index;
|
||||
@ -576,9 +559,6 @@ static void fakename_get_name(FAKENAME_STREAMFILE *streamfile, char *buffer, siz
|
||||
strncpy(buffer,streamfile->fakename,length);
|
||||
buffer[length-1]='\0';
|
||||
}
|
||||
static void fakename_get_realname(FAKENAME_STREAMFILE *streamfile, char *buffer, size_t length) {
|
||||
fakename_get_name(streamfile, buffer, length);
|
||||
}
|
||||
static STREAMFILE *fakename_open(FAKENAME_STREAMFILE *streamfile, const char * const filename, size_t buffersize) {
|
||||
/* detect re-opening the file */
|
||||
if (strcmp(filename, streamfile->fakename) == 0) {
|
||||
@ -611,7 +591,6 @@ STREAMFILE *open_fakename_streamfile(STREAMFILE *streamfile, const char * fakena
|
||||
this_sf->sf.get_size = (void*)fakename_get_size;
|
||||
this_sf->sf.get_offset = (void*)fakename_get_offset;
|
||||
this_sf->sf.get_name = (void*)fakename_get_name;
|
||||
this_sf->sf.get_realname = (void*)fakename_get_realname;
|
||||
this_sf->sf.open = (void*)fakename_open;
|
||||
this_sf->sf.close = (void*)fakename_close;
|
||||
this_sf->sf.stream_index = streamfile->stream_index;
|
||||
@ -692,9 +671,6 @@ static size_t multifile_get_offset(MULTIFILE_STREAMFILE * streamfile) {
|
||||
static void multifile_get_name(MULTIFILE_STREAMFILE *streamfile, char *buffer, size_t length) {
|
||||
streamfile->inner_sfs[0]->get_name(streamfile->inner_sfs[0], buffer, length);
|
||||
}
|
||||
static void multifile_get_realname(MULTIFILE_STREAMFILE *streamfile, char *buffer, size_t length) {
|
||||
multifile_get_name(streamfile, buffer, length);
|
||||
}
|
||||
static STREAMFILE *multifile_open(MULTIFILE_STREAMFILE *streamfile, const char * const filename, size_t buffersize) {
|
||||
char original_filename[PATH_LIMIT];
|
||||
STREAMFILE *new_sf = NULL;
|
||||
@ -760,7 +736,6 @@ STREAMFILE *open_multifile_streamfile(STREAMFILE **streamfiles, size_t streamfil
|
||||
this_sf->sf.get_size = (void*)multifile_get_size;
|
||||
this_sf->sf.get_offset = (void*)multifile_get_offset;
|
||||
this_sf->sf.get_name = (void*)multifile_get_name;
|
||||
this_sf->sf.get_realname = (void*)multifile_get_realname;
|
||||
this_sf->sf.open = (void*)multifile_open;
|
||||
this_sf->sf.close = (void*)multifile_close;
|
||||
this_sf->sf.stream_index = streamfiles[0]->stream_index;
|
||||
|
@ -51,8 +51,6 @@ typedef struct _STREAMFILE {
|
||||
off_t (*get_offset)(struct _STREAMFILE *);
|
||||
/* for dual-file support */
|
||||
void (*get_name)(struct _STREAMFILE *,char *name,size_t length);
|
||||
/* for when the "name" is encoded specially, this is the actual user visible name */
|
||||
void (*get_realname)(struct _STREAMFILE *,char *name,size_t length);
|
||||
struct _STREAMFILE * (*open)(struct _STREAMFILE *,const char * const filename,size_t buffersize);
|
||||
void (*close)(struct _STREAMFILE *);
|
||||
|
||||
|
@ -173,10 +173,6 @@ static void wasf_get_name(WINAMP_STREAMFILE *streamfile, char *buffer, size_t le
|
||||
streamfile->stdiosf->get_name(streamfile->stdiosf, buffer, length);
|
||||
}
|
||||
|
||||
static void wasf_get_realname(WINAMP_STREAMFILE *streamfile, char *buffer, size_t length) {
|
||||
streamfile->stdiosf->get_realname(streamfile->stdiosf, buffer, length);
|
||||
}
|
||||
|
||||
static STREAMFILE *wasf_open(WINAMP_STREAMFILE *streamFile, const char *const filename, size_t buffersize) {
|
||||
int newfd;
|
||||
FILE *newfile;
|
||||
@ -227,7 +223,6 @@ static STREAMFILE *open_winamp_streamfile_by_file(FILE *infile, const char * pat
|
||||
this_sf->sf.get_size = (void*)wasf_get_size;
|
||||
this_sf->sf.get_offset = (void*)wasf_get_offset;
|
||||
this_sf->sf.get_name = (void*)wasf_get_name;
|
||||
this_sf->sf.get_realname = (void*)wasf_get_realname;
|
||||
this_sf->sf.open = (void*)wasf_open;
|
||||
this_sf->sf.close = (void*)wasf_close;
|
||||
|
||||
|
@ -127,7 +127,6 @@ static STREAMFILE *open_xmplay_streamfile_by_xmpfile(XMPFILE infile, const char
|
||||
streamfile->sf.get_size = (void*)xmpsf_get_size;
|
||||
streamfile->sf.get_offset = (void*)xmpsf_get_offset;
|
||||
streamfile->sf.get_name = (void*)xmpsf_get_name;
|
||||
streamfile->sf.get_realname = (void*)xmpsf_get_name;
|
||||
streamfile->sf.open = (void*)xmpsf_open;
|
||||
streamfile->sf.close = (void*)xmpsf_close;
|
||||
streamfile->infile = infile;
|
||||
|
Loading…
Reference in New Issue
Block a user