add ogg metainfo parsing, and ogg playback. fix problems with not recognizing when to transcode on rsp

This commit is contained in:
Ron Pedde 2006-05-28 08:45:44 +00:00
parent e7d04dbd6b
commit 1dfb7d0bc0
6 changed files with 37 additions and 26 deletions

View File

@ -130,6 +130,7 @@ typedef struct tag_plugin_input_fn {
char* (*server_ver)(void);
int (*server_name)(char *, int *);
void (*log)(int, char *, ...);
int (*can_transcode)(char *);
int (*db_count)(void);
int (*db_enum_start)(char **, DB_QUERY *);

View File

@ -203,7 +203,7 @@ void scan_process_playlistlist(void) {
while(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;
if(strrchr(pnext->path,'.')) {
ext = strrchr(pnext->path,'.');

View File

@ -108,6 +108,7 @@ PLUGIN_INPUT_FN pi = {
pi_server_ver,
pi_server_name,
pi_log,
plugin_ssc_can_transcode,
pi_db_count,
pi_db_enum_start,

View File

@ -339,23 +339,25 @@ void rsp_playlist(WS_CONNINFO *pwsc, PRIVINFO *ppi) {
int returned;
char *browse_type;
int type;
char *transcode_codecs;
int transcode;
int samplerate;
// char *user_agent;
/*
char *user_agent;
char *native_codecs;
native_codecs = _ppi->ws_getrequestheader(pwsc,"accept-codecs");
if(!native_codecs) {
user_agent = _ppi->ws_getrequestheader(pwsc,"user-agent");
if(user_agent) {
if(strncmp(user_agent,"iTunes",6)==0) {
trancode_codecs = "wma,ogg,flac,mpc";
native_codecs = "mpeg,mp4a,wav,mp4v";
} else if(strncmp(user_agent,"Roku",4)==0) {
transcode_codecs = "ogg,flac,mpc,alac";
native_codecs = "mpeg,mp4a,wav,wma";
} else {
transcode_codecs = "wma,ogg,flac,mpc,alac";
native_codecs = "mpeg,mp4a,wav";
}
}
}
*/
ppi->dq.filter = _ppi->ws_getvar(pwsc,"query");
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;
}
transcode_codecs = _ppi->conf_alloc_string("general","ssc_codectypes","");
xml_push(pxml,"response");
xml_push(pxml,"status");
xml_output(pxml,"errorcode","0");
@ -413,8 +413,12 @@ void rsp_playlist(WS_CONNINFO *pwsc, PRIVINFO *ppi) {
xml_push(pxml,"item");
rowindex=0;
transcode = 0;
if(strstr(transcode_codecs,row[37])) /* FIXME: ticket #21 */
if(!strstr(native_codecs,row[37])) {
if(_ppi->can_transcode(row[37])) {
transcode = 1;
}
}
while(rsp_fields[rowindex].name) {
if((rsp_fields[rowindex].flags & type) &&
@ -438,6 +442,7 @@ void rsp_playlist(WS_CONNINFO *pwsc, PRIVINFO *ppi) {
break;
case 37:
xml_output(pxml,rsp_fields[rowindex].name,"%s","wav");
xml_output(pxml,"original_codec","%s",row[37]);
break;
default:
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->conf_dispose_string(transcode_codecs);
xml_pop(pxml); /* items */
xml_pop(pxml); /* response */

View File

@ -21,10 +21,10 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="$(InputDir),..\src,.,.."
PreprocessorDefinitions="HAVE_CONFIG_H;ZLIB_DLL;_WINDOWS;FLAC"
PreprocessorDefinitions="HAVE_CONFIG_H;ZLIB_DLL;_WINDOWS;FLAC;OGGVORBIS"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
@ -33,11 +33,11 @@
Name="VCCustomBuildTool"/>
<Tool
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"
LinkIncremental="2"
AdditionalLibraryDirectories=""
IgnoreDefaultLibraryNames="LIBC"
IgnoreDefaultLibraryNames="libc"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/mt-daapd.pdb"
SubSystem="1"
@ -74,8 +74,8 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="$(InputDir),..\src,.,.."
PreprocessorDefinitions="HAVE_CONFIG_H;ZLIB_DLL;_WINDOWS;FLAC"
RuntimeLibrary="4"
PreprocessorDefinitions="HAVE_CONFIG_H;ZLIB_DLL;_WINDOWS;FLAC;OGGVORBIS"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
@ -84,11 +84,11 @@
Name="VCCustomBuildTool"/>
<Tool
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"
LinkIncremental="1"
AdditionalLibraryDirectories=""
IgnoreDefaultLibraryNames=""
IgnoreDefaultLibraryNames="libc"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
@ -197,6 +197,9 @@
<File
RelativePath="..\src\scan-mp4.c">
</File>
<File
RelativePath="..\src\scan-ogg.c">
</File>
<File
RelativePath="..\src\scan-url.c">
</File>

View File

@ -160,6 +160,7 @@ Section "MainSection" SEC01
File "${ADMIN_ROOT}\applet.html"
File "${ADMIN_ROOT}\spinner.gif"
File "${ADMIN_ROOT}\util.js"
File "${ADMIN_ROOT}\pngfix.js"
SetOutPath "$2\admin-root\lib-js"
File "${ADMIN_ROOT}\lib-js\prototype.js"
File "${ADMIN_ROOT}\lib-js\rico.js"
@ -443,6 +444,7 @@ Section Uninstall
Delete "$INSTDIR\admin-root\smart.js"
Delete "$INSTDIR\admin-root\spinner.gif"
Delete "$INSTDIR\admin-root\util.js"
Delete "$INSTDIR\admin-root\pngfix.js"
Delete "$INSTDIR\admin-root\smartpopup.html"
Delete "$INSTDIR\admin-root\status.html"
Delete "$INSTDIR\admin-root\status.js"