mirror of
https://gitlab.xiph.org/xiph/ezstream.git
synced 2025-02-02 15:07:45 -05:00
add passthorough support for unknown types
git-svn-id: https://svn.xiph.org/trunk/ezstream@8519 0101bb08-14d6-0310-b084-bc0e0c8e3800
This commit is contained in:
parent
07688873e2
commit
d23ebe69e8
@ -139,25 +139,44 @@ char* buildCommandString(char *extension, char *fileName, char *metadata)
|
|||||||
printf("Unknown extension %s, cannot decode\n", extension);
|
printf("Unknown extension %s, cannot decode\n", extension);
|
||||||
return commandString;
|
return commandString;
|
||||||
}
|
}
|
||||||
encoder = strdup(getFormatEncoder(pezConfig->format));
|
|
||||||
if (strlen(encoder) == 0) {
|
|
||||||
printf("Unknown format %s, cannot encode\n", pezConfig->format);
|
|
||||||
return commandString;
|
|
||||||
}
|
|
||||||
newDecoderLen = strlen(decoder) + strlen(fileName) + 1;
|
newDecoderLen = strlen(decoder) + strlen(fileName) + 1;
|
||||||
newDecoder = (char *)malloc(newDecoderLen);
|
newDecoder = (char *)malloc(newDecoderLen);
|
||||||
memset(newDecoder, '\000', newDecoderLen);
|
memset(newDecoder, '\000', newDecoderLen);
|
||||||
ReplaceString(decoder, newDecoder, "@T@", fileName);
|
ReplaceString(decoder, newDecoder, "@T@", fileName);
|
||||||
|
|
||||||
newEncoderLen = strlen(encoder) + strlen(metadata) + 1;
|
encoder = strdup(getFormatEncoder(pezConfig->format));
|
||||||
newEncoder = (char *)malloc(newEncoderLen);
|
if (strlen(encoder) == 0) {
|
||||||
memset(newEncoder, '\000', newEncoderLen);
|
printf("Unknown format %s, passing right on through!\n", pezConfig->format);
|
||||||
ReplaceString(encoder, newEncoder, "@M@", metadata);
|
commandStringLen = strlen(newDecoder) + 1;
|
||||||
|
commandString = (char *)malloc(commandStringLen);
|
||||||
|
memset(commandString, '\000', commandStringLen);
|
||||||
|
sprintf(commandString, "%s", newDecoder);
|
||||||
|
if (decoder) {
|
||||||
|
free(decoder);
|
||||||
|
}
|
||||||
|
if (encoder) {
|
||||||
|
free(encoder);
|
||||||
|
}
|
||||||
|
return commandString;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
commandStringLen = strlen(newDecoder) + strlen(" | ") + strlen(newEncoder) + 1;
|
newEncoderLen = strlen(encoder) + strlen(metadata) + 1;
|
||||||
commandString = (char *)malloc(commandStringLen);
|
newEncoder = (char *)malloc(newEncoderLen);
|
||||||
memset(commandString, '\000', commandStringLen);
|
memset(newEncoder, '\000', newEncoderLen);
|
||||||
sprintf(commandString, "%s | %s", newDecoder, newEncoder);
|
ReplaceString(encoder, newEncoder, "@M@", metadata);
|
||||||
|
|
||||||
|
commandStringLen = strlen(newDecoder) + strlen(" | ") + strlen(newEncoder) + 1;
|
||||||
|
commandString = (char *)malloc(commandStringLen);
|
||||||
|
memset(commandString, '\000', commandStringLen);
|
||||||
|
sprintf(commandString, "%s | %s", newDecoder, newEncoder);
|
||||||
|
}
|
||||||
|
if (decoder) {
|
||||||
|
free(decoder);
|
||||||
|
}
|
||||||
|
if (encoder) {
|
||||||
|
free(encoder);
|
||||||
|
}
|
||||||
printf("Going to execute (%s)\n", commandString);
|
printf("Going to execute (%s)\n", commandString);
|
||||||
return(commandString);
|
return(commandString);
|
||||||
}
|
}
|
||||||
@ -279,6 +298,7 @@ FILE *openResource(shout_t *shout, char *fileName)
|
|||||||
_setmode(_fileno(stdin), _O_BINARY);
|
_setmode(_fileno(stdin), _O_BINARY);
|
||||||
#endif
|
#endif
|
||||||
filep = stdin;
|
filep = stdin;
|
||||||
|
return filep;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
char extension[25];
|
char extension[25];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user