mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-01 09:51:13 +02:00
gui/audioplayer.cpp: add urls from m3u
Origin commit data
------------------
Branch: ni/coolstream
Commit: 4c2ad26dea
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2012-06-18 (Mon, 18 Jun 2012)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -1294,6 +1294,7 @@ bool CAudioPlayerGui::openFilebrowser(void)
|
|||||||
std::string sPath = files->Name.substr(0, files->Name.rfind('/'));
|
std::string sPath = files->Name.substr(0, files->Name.rfind('/'));
|
||||||
std::ifstream infile;
|
std::ifstream infile;
|
||||||
char cLine[256];
|
char cLine[256];
|
||||||
|
char name[255] = { 0 };
|
||||||
infile.open(files->Name.c_str(), std::ifstream::in);
|
infile.open(files->Name.c_str(), std::ifstream::in);
|
||||||
while (infile.good())
|
while (infile.good())
|
||||||
{
|
{
|
||||||
@@ -1301,12 +1302,16 @@ bool CAudioPlayerGui::openFilebrowser(void)
|
|||||||
// remove CR
|
// remove CR
|
||||||
if (cLine[strlen(cLine)-1]=='\r')
|
if (cLine[strlen(cLine)-1]=='\r')
|
||||||
cLine[strlen(cLine)-1]=0;
|
cLine[strlen(cLine)-1]=0;
|
||||||
|
int duration;
|
||||||
|
sscanf(cLine, "#EXTINF:%d,%[^\n]\n", &duration, name);
|
||||||
if (strlen(cLine) > 0 && cLine[0]!='#')
|
if (strlen(cLine) > 0 && cLine[0]!='#')
|
||||||
{
|
{
|
||||||
char *url = strstr(cLine, "http://");
|
char *url = strstr(cLine, "http://");
|
||||||
if (url != NULL) {
|
if (url != NULL) {
|
||||||
if (strstr(url, ".m3u") || strstr(url, ".pls"))
|
if (strstr(url, ".m3u") || strstr(url, ".pls"))
|
||||||
processPlaylistUrl(url);
|
processPlaylistUrl(url);
|
||||||
|
else
|
||||||
|
addUrl2Playlist(url, name, duration);
|
||||||
} else if ((url = strstr(cLine, "icy://")) != NULL) {
|
} else if ((url = strstr(cLine, "icy://")) != NULL) {
|
||||||
addUrl2Playlist(url);
|
addUrl2Playlist(url);
|
||||||
} else if ((url = strstr(cLine, "scast:://")) != NULL) {
|
} else if ((url = strstr(cLine, "scast:://")) != NULL) {
|
||||||
|
Reference in New Issue
Block a user