1
0
mirror of https://gitlab.xiph.org/xiph/ezstream.git synced 2024-11-03 04:17:18 -05:00

Ticket #1225, reported by matpoc at lenta dot ru: Bring back special case

for streaming MP3 files without reencoding, which was lost during the many
changes in 0.3.0 and subsequently forgotten. Sorry for the inconvenience,
and thanks for the report.


git-svn-id: https://svn.xiph.org/trunk/ezstream@13542 0101bb08-14d6-0310-b084-bc0e0c8e3800
This commit is contained in:
moritz 2007-08-14 03:32:13 +00:00
parent e2a0a9a1bb
commit a4b1f2b7f6
3 changed files with 32 additions and 9 deletions

View File

@ -624,7 +624,9 @@ openResource(shout_t *shout, const char *fileName, int *popenFlag,
close(stderr_fd); close(stderr_fd);
return (filep); return (filep);
} } else if (strrcasecmp(fileName, ".mp3") == 0)
/* MP3 streams are special: */
setMetadata(shout, mdata, NULL);
metadata_free(&mdata); metadata_free(&mdata);
@ -816,7 +818,7 @@ sendStream(shout_t *shout, FILE *filepstream, const char *fileName,
clearerr(filepstream); clearerr(filepstream);
ret = STREAM_CONT; ret = STREAM_CONT;
} else } else
printf("%s: streamFile(): Error while reading '%s': %s\n", printf("%s: sendStream(): Error while reading '%s': %s\n",
__progname, fileName, strerror(errno)); __progname, fileName, strerror(errno));
} }
@ -1306,21 +1308,16 @@ main(int argc, char *argv[])
if (shout_open(shout) == SHOUTERR_SUCCESS) { if (shout_open(shout) == SHOUTERR_SUCCESS) {
int ret; int ret;
char *tmpFileName, *p;
printf("%s: Connected to http://%s:%d%s\n", __progname, printf("%s: Connected to http://%s:%d%s\n", __progname,
host, port, mount); host, port, mount);
tmpFileName = xstrdup(pezConfig->fileName);
for (p = tmpFileName; *p != '\0'; p++)
*p = tolower((int)*p);
if (pezConfig->fileNameIsProgram || if (pezConfig->fileNameIsProgram ||
strrcmp(tmpFileName, ".m3u") == 0 || strrcasecmp(pezConfig->fileName, ".m3u") == 0 ||
strrcmp(tmpFileName, ".txt") == 0) strrcasecmp(pezConfig->fileName, ".txt") == 0)
playlistMode = 1; playlistMode = 1;
else else
playlistMode = 0; playlistMode = 0;
xfree(tmpFileName);
if (vFlag && pezConfig->fileNameIsProgram) if (vFlag && pezConfig->fileNameIsProgram)
printf("%s: Using program '%s' to get filenames for streaming\n", printf("%s: Using program '%s' to get filenames for streaming\n",

View File

@ -21,9 +21,12 @@
# include "config.h" # include "config.h"
#endif #endif
#include <ctype.h>
#include <stdio.h>
#include <string.h> #include <string.h>
#include "util.h" #include "util.h"
#include "xalloc.h"
int int
strrcmp(const char *s, const char *sub) strrcmp(const char *s, const char *sub)
@ -36,3 +39,25 @@ strrcmp(const char *s, const char *sub)
return (memcmp(s + slen - sublen, sub, sublen)); return (memcmp(s + slen - sublen, sub, sublen));
} }
int
strrcasecmp(const char *s, const char *sub)
{
char *s_cpy = xstrdup(s);
char *sub_cpy = xstrdup(sub);
char *p;
int ret;
for (p = s_cpy; *p != '\0'; p++)
*p = tolower((int)*p);
for (p = sub_cpy; *p != '\0'; p++)
*p = tolower((int)*p);
ret = strrcmp(s_cpy, sub_cpy);
xfree(s_cpy);
xfree(sub_cpy);
return (ret);
}

View File

@ -21,5 +21,6 @@
#define __UTIL_H__ #define __UTIL_H__
int strrcmp(const char *, const char *); int strrcmp(const char *, const char *);
int strrcasecmp(const char *, const char *);
#endif /* __UTIL_H__ */ #endif /* __UTIL_H__ */