mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-24 13:13:17 -05:00
add ogg metainfo parsing, and ogg playback. fix problems with not recognizing when to transcode on rsp
This commit is contained in:
parent
e7d04dbd6b
commit
1dfb7d0bc0
@ -130,6 +130,7 @@ typedef struct tag_plugin_input_fn {
|
|||||||
char* (*server_ver)(void);
|
char* (*server_ver)(void);
|
||||||
int (*server_name)(char *, int *);
|
int (*server_name)(char *, int *);
|
||||||
void (*log)(int, char *, ...);
|
void (*log)(int, char *, ...);
|
||||||
|
int (*can_transcode)(char *);
|
||||||
|
|
||||||
int (*db_count)(void);
|
int (*db_count)(void);
|
||||||
int (*db_enum_start)(char **, DB_QUERY *);
|
int (*db_enum_start)(char **, DB_QUERY *);
|
||||||
|
@ -203,7 +203,7 @@ void scan_process_playlistlist(void) {
|
|||||||
while(scan_playlistlist.next) {
|
while(scan_playlistlist.next) {
|
||||||
pnext=scan_playlistlist.next;
|
pnext=scan_playlistlist.next;
|
||||||
|
|
||||||
DPRINTF(E_DBG,L_SCAN,"About to scan %S\n",pnext->path);
|
DPRINTF(E_DBG,L_SCAN,"About to scan %s\n",pnext->path);
|
||||||
ext=pnext->path;
|
ext=pnext->path;
|
||||||
if(strrchr(pnext->path,'.')) {
|
if(strrchr(pnext->path,'.')) {
|
||||||
ext = strrchr(pnext->path,'.');
|
ext = strrchr(pnext->path,'.');
|
||||||
|
@ -108,6 +108,7 @@ PLUGIN_INPUT_FN pi = {
|
|||||||
pi_server_ver,
|
pi_server_ver,
|
||||||
pi_server_name,
|
pi_server_name,
|
||||||
pi_log,
|
pi_log,
|
||||||
|
plugin_ssc_can_transcode,
|
||||||
|
|
||||||
pi_db_count,
|
pi_db_count,
|
||||||
pi_db_enum_start,
|
pi_db_enum_start,
|
||||||
|
@ -339,23 +339,25 @@ void rsp_playlist(WS_CONNINFO *pwsc, PRIVINFO *ppi) {
|
|||||||
int returned;
|
int returned;
|
||||||
char *browse_type;
|
char *browse_type;
|
||||||
int type;
|
int type;
|
||||||
char *transcode_codecs;
|
|
||||||
int transcode;
|
int transcode;
|
||||||
int samplerate;
|
int samplerate;
|
||||||
// char *user_agent;
|
|
||||||
|
|
||||||
/*
|
char *user_agent;
|
||||||
user_agent = _ppi->ws_getrequestheader(pwsc,"user-agent");
|
char *native_codecs;
|
||||||
if(user_agent) {
|
|
||||||
if(strncmp(user_agent,"iTunes",6)==0) {
|
native_codecs = _ppi->ws_getrequestheader(pwsc,"accept-codecs");
|
||||||
trancode_codecs = "wma,ogg,flac,mpc";
|
if(!native_codecs) {
|
||||||
} else if(strncmp(user_agent,"Roku",4)==0) {
|
user_agent = _ppi->ws_getrequestheader(pwsc,"user-agent");
|
||||||
transcode_codecs = "ogg,flac,mpc,alac";
|
if(user_agent) {
|
||||||
} else {
|
if(strncmp(user_agent,"iTunes",6)==0) {
|
||||||
transcode_codecs = "wma,ogg,flac,mpc,alac";
|
native_codecs = "mpeg,mp4a,wav,mp4v";
|
||||||
|
} else if(strncmp(user_agent,"Roku",4)==0) {
|
||||||
|
native_codecs = "mpeg,mp4a,wav,wma";
|
||||||
|
} else {
|
||||||
|
native_codecs = "mpeg,mp4a,wav";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
ppi->dq.filter = _ppi->ws_getvar(pwsc,"query");
|
ppi->dq.filter = _ppi->ws_getvar(pwsc,"query");
|
||||||
ppi->dq.filter_type = FILTER_TYPE_FIREFLY;
|
ppi->dq.filter_type = FILTER_TYPE_FIREFLY;
|
||||||
@ -397,8 +399,6 @@ void rsp_playlist(WS_CONNINFO *pwsc, PRIVINFO *ppi) {
|
|||||||
returned = ppi->dq.totalcount - ppi->dq.offset;
|
returned = ppi->dq.totalcount - ppi->dq.offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
transcode_codecs = _ppi->conf_alloc_string("general","ssc_codectypes","");
|
|
||||||
|
|
||||||
xml_push(pxml,"response");
|
xml_push(pxml,"response");
|
||||||
xml_push(pxml,"status");
|
xml_push(pxml,"status");
|
||||||
xml_output(pxml,"errorcode","0");
|
xml_output(pxml,"errorcode","0");
|
||||||
@ -413,8 +413,12 @@ void rsp_playlist(WS_CONNINFO *pwsc, PRIVINFO *ppi) {
|
|||||||
xml_push(pxml,"item");
|
xml_push(pxml,"item");
|
||||||
rowindex=0;
|
rowindex=0;
|
||||||
transcode = 0;
|
transcode = 0;
|
||||||
if(strstr(transcode_codecs,row[37])) /* FIXME: ticket #21 */
|
|
||||||
transcode = 1;
|
if(!strstr(native_codecs,row[37])) {
|
||||||
|
if(_ppi->can_transcode(row[37])) {
|
||||||
|
transcode = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
while(rsp_fields[rowindex].name) {
|
while(rsp_fields[rowindex].name) {
|
||||||
if((rsp_fields[rowindex].flags & type) &&
|
if((rsp_fields[rowindex].flags & type) &&
|
||||||
@ -438,6 +442,7 @@ void rsp_playlist(WS_CONNINFO *pwsc, PRIVINFO *ppi) {
|
|||||||
break;
|
break;
|
||||||
case 37:
|
case 37:
|
||||||
xml_output(pxml,rsp_fields[rowindex].name,"%s","wav");
|
xml_output(pxml,rsp_fields[rowindex].name,"%s","wav");
|
||||||
|
xml_output(pxml,"original_codec","%s",row[37]);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
xml_output(pxml,rsp_fields[rowindex].name,"%s",
|
xml_output(pxml,rsp_fields[rowindex].name,"%s",
|
||||||
@ -456,7 +461,6 @@ void rsp_playlist(WS_CONNINFO *pwsc, PRIVINFO *ppi) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_ppi->db_enum_end(NULL);
|
_ppi->db_enum_end(NULL);
|
||||||
_ppi->conf_dispose_string(transcode_codecs);
|
|
||||||
|
|
||||||
xml_pop(pxml); /* items */
|
xml_pop(pxml); /* items */
|
||||||
xml_pop(pxml); /* response */
|
xml_pop(pxml); /* response */
|
||||||
|
@ -21,10 +21,10 @@
|
|||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
AdditionalIncludeDirectories="$(InputDir),..\src,.,.."
|
AdditionalIncludeDirectories="$(InputDir),..\src,.,.."
|
||||||
PreprocessorDefinitions="HAVE_CONFIG_H;ZLIB_DLL;_WINDOWS;FLAC"
|
PreprocessorDefinitions="HAVE_CONFIG_H;ZLIB_DLL;_WINDOWS;FLAC;OGGVORBIS"
|
||||||
MinimalRebuild="TRUE"
|
MinimalRebuild="TRUE"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
RuntimeLibrary="5"
|
RuntimeLibrary="1"
|
||||||
UsePrecompiledHeader="0"
|
UsePrecompiledHeader="0"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
Detect64BitPortabilityProblems="TRUE"
|
Detect64BitPortabilityProblems="TRUE"
|
||||||
@ -33,11 +33,11 @@
|
|||||||
Name="VCCustomBuildTool"/>
|
Name="VCCustomBuildTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalDependencies="zdll.lib libid3tag.lib gnu_regex.lib pthreadVC2.lib wsock32.lib sqlite3.lib sqlite.lib dnssd.lib libFLAC.lib"
|
AdditionalDependencies="zdll.lib libid3tag.lib gnu_regex.lib pthreadVC2.lib wsock32.lib sqlite3.lib sqlite.lib dnssd.lib libFLAC.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib"
|
||||||
OutputFile="$(OutDir)/mt-daapd.exe"
|
OutputFile="$(OutDir)/mt-daapd.exe"
|
||||||
LinkIncremental="2"
|
LinkIncremental="2"
|
||||||
AdditionalLibraryDirectories=""
|
AdditionalLibraryDirectories=""
|
||||||
IgnoreDefaultLibraryNames="LIBC"
|
IgnoreDefaultLibraryNames="libc"
|
||||||
GenerateDebugInformation="TRUE"
|
GenerateDebugInformation="TRUE"
|
||||||
ProgramDatabaseFile="$(OutDir)/mt-daapd.pdb"
|
ProgramDatabaseFile="$(OutDir)/mt-daapd.pdb"
|
||||||
SubSystem="1"
|
SubSystem="1"
|
||||||
@ -74,8 +74,8 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
AdditionalIncludeDirectories="$(InputDir),..\src,.,.."
|
AdditionalIncludeDirectories="$(InputDir),..\src,.,.."
|
||||||
PreprocessorDefinitions="HAVE_CONFIG_H;ZLIB_DLL;_WINDOWS;FLAC"
|
PreprocessorDefinitions="HAVE_CONFIG_H;ZLIB_DLL;_WINDOWS;FLAC;OGGVORBIS"
|
||||||
RuntimeLibrary="4"
|
RuntimeLibrary="0"
|
||||||
UsePrecompiledHeader="0"
|
UsePrecompiledHeader="0"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
Detect64BitPortabilityProblems="TRUE"
|
Detect64BitPortabilityProblems="TRUE"
|
||||||
@ -84,11 +84,11 @@
|
|||||||
Name="VCCustomBuildTool"/>
|
Name="VCCustomBuildTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalDependencies="zdll.lib libid3tag.lib gnu_regex.lib pthreadVC2.lib wsock32.lib sqlite3.lib sqlite.lib dnssd.lib libFLAC.lib"
|
AdditionalDependencies="zdll.lib libid3tag.lib gnu_regex.lib pthreadVC2.lib wsock32.lib sqlite3.lib sqlite.lib dnssd.lib libFLAC.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib"
|
||||||
OutputFile="$(OutDir)/mt-daapd.exe"
|
OutputFile="$(OutDir)/mt-daapd.exe"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
AdditionalLibraryDirectories=""
|
AdditionalLibraryDirectories=""
|
||||||
IgnoreDefaultLibraryNames=""
|
IgnoreDefaultLibraryNames="libc"
|
||||||
GenerateDebugInformation="TRUE"
|
GenerateDebugInformation="TRUE"
|
||||||
SubSystem="1"
|
SubSystem="1"
|
||||||
OptimizeReferences="2"
|
OptimizeReferences="2"
|
||||||
@ -197,6 +197,9 @@
|
|||||||
<File
|
<File
|
||||||
RelativePath="..\src\scan-mp4.c">
|
RelativePath="..\src\scan-mp4.c">
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\src\scan-ogg.c">
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\src\scan-url.c">
|
RelativePath="..\src\scan-url.c">
|
||||||
</File>
|
</File>
|
||||||
|
@ -160,6 +160,7 @@ Section "MainSection" SEC01
|
|||||||
File "${ADMIN_ROOT}\applet.html"
|
File "${ADMIN_ROOT}\applet.html"
|
||||||
File "${ADMIN_ROOT}\spinner.gif"
|
File "${ADMIN_ROOT}\spinner.gif"
|
||||||
File "${ADMIN_ROOT}\util.js"
|
File "${ADMIN_ROOT}\util.js"
|
||||||
|
File "${ADMIN_ROOT}\pngfix.js"
|
||||||
SetOutPath "$2\admin-root\lib-js"
|
SetOutPath "$2\admin-root\lib-js"
|
||||||
File "${ADMIN_ROOT}\lib-js\prototype.js"
|
File "${ADMIN_ROOT}\lib-js\prototype.js"
|
||||||
File "${ADMIN_ROOT}\lib-js\rico.js"
|
File "${ADMIN_ROOT}\lib-js\rico.js"
|
||||||
@ -443,6 +444,7 @@ Section Uninstall
|
|||||||
Delete "$INSTDIR\admin-root\smart.js"
|
Delete "$INSTDIR\admin-root\smart.js"
|
||||||
Delete "$INSTDIR\admin-root\spinner.gif"
|
Delete "$INSTDIR\admin-root\spinner.gif"
|
||||||
Delete "$INSTDIR\admin-root\util.js"
|
Delete "$INSTDIR\admin-root\util.js"
|
||||||
|
Delete "$INSTDIR\admin-root\pngfix.js"
|
||||||
Delete "$INSTDIR\admin-root\smartpopup.html"
|
Delete "$INSTDIR\admin-root\smartpopup.html"
|
||||||
Delete "$INSTDIR\admin-root\status.html"
|
Delete "$INSTDIR\admin-root\status.html"
|
||||||
Delete "$INSTDIR\admin-root\status.js"
|
Delete "$INSTDIR\admin-root\status.js"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user