Compare commits
No commits in common. "4cbe796774e038855fdac5fe11e13bb6841ed7c8" and "1a9b32ee7a1c89e54e9f148199b73f9b33ad45ba" have entirely different histories.
4cbe796774
...
1a9b32ee7a
@ -15,7 +15,7 @@
|
|||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||||
# USA.
|
# USA.
|
||||||
|
|
||||||
AM_CFLAGS = -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 @libpng_CFLAGS@ @opus_CFLAGS@
|
AM_CFLAGS = -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
|
||||||
|
|
||||||
SUBDIRS=po
|
SUBDIRS=po
|
||||||
|
|
||||||
@ -62,8 +62,7 @@ minidlnad_LDADD = \
|
|||||||
@LIBEXIF_LIBS@ \
|
@LIBEXIF_LIBS@ \
|
||||||
@LIBINTL@ \
|
@LIBINTL@ \
|
||||||
@LIBICONV@ \
|
@LIBICONV@ \
|
||||||
-lFLAC $(flacogglibs) $(vorbislibs) $(avahilibs) \
|
-lFLAC $(flacogglibs) $(vorbislibs) $(avahilibs)
|
||||||
@opus_LIBS@
|
|
||||||
|
|
||||||
testupnpdescgen_SOURCES = testupnpdescgen.c upnpdescgen.c
|
testupnpdescgen_SOURCES = testupnpdescgen.c upnpdescgen.c
|
||||||
testupnpdescgen_LDADD = \
|
testupnpdescgen_LDADD = \
|
||||||
|
@ -462,12 +462,6 @@ AC_CHECK_LIB(vorbisfile, ov_open_callbacks,
|
|||||||
AM_CONDITIONAL(HAVE_VORBISFILE, false))],
|
AM_CONDITIONAL(HAVE_VORBISFILE, false))],
|
||||||
AM_CONDITIONAL(HAVE_VORBISFILE, false),
|
AM_CONDITIONAL(HAVE_VORBISFILE, false),
|
||||||
-lvorbis -logg)
|
-lvorbis -logg)
|
||||||
#test if we have opus/opusfile
|
|
||||||
|
|
||||||
PKG_CHECK_MODULES([opus], [opus opusfile],
|
|
||||||
AM_CONDITIONAL(HAVE_OPUS, true)
|
|
||||||
AC_DEFINE(HAVE_OPUS,1,[Define to 1 if you have opus/opusfile]),
|
|
||||||
AM_CONDITIONAL(HAVE_OPUS, false))
|
|
||||||
AC_CHECK_LIB(FLAC, FLAC__stream_decoder_init_stream,
|
AC_CHECK_LIB(FLAC, FLAC__stream_decoder_init_stream,
|
||||||
[AC_CHECK_HEADERS([FLAC/all.h],
|
[AC_CHECK_HEADERS([FLAC/all.h],
|
||||||
AM_CONDITIONAL(HAVE_FLAC, true)
|
AM_CONDITIONAL(HAVE_FLAC, true)
|
||||||
|
48
metadata.c
48
metadata.c
@ -343,55 +343,11 @@ GetAudioMetadata(const char *path, const char *name)
|
|||||||
strcpy(type, "wav");
|
strcpy(type, "wav");
|
||||||
m.mime = strdup("audio/x-wav");
|
m.mime = strdup("audio/x-wav");
|
||||||
}
|
}
|
||||||
else if( ends_with(path,".oga") || ends_with(path,".ogg"))
|
else if( ends_with(path, ".ogg") || ends_with(path, ".oga") )
|
||||||
{
|
{
|
||||||
/* The .ogg/.oga file extensions present something of a problem.
|
|
||||||
* ".ogg" has been deprecated in favor of ".oga" for some time, but
|
|
||||||
* many applications still only recognize ".ogg".
|
|
||||||
*
|
|
||||||
* This examines the file and causes .ogg to be presented for any naked
|
|
||||||
* Vorbis file (MIME type audio/ogg; codecs=vorbis) and .oga
|
|
||||||
* (audio/ogg) to be used for everything else. This is in line with
|
|
||||||
* the official ogg naming conventions and, hopefully, makes for a
|
|
||||||
* resonable compromise.
|
|
||||||
*/
|
|
||||||
uint8_t oggtestbuf[35];
|
|
||||||
FILE *oggfile = fopen (path, "rb");
|
|
||||||
|
|
||||||
if (oggfile == (FILE *)NULL)
|
|
||||||
{
|
|
||||||
DPRINTF(E_ERROR, L_METADATA, "Error opening %s\n", path);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fread (oggtestbuf, 1, 35, oggfile) != 35)
|
|
||||||
{
|
|
||||||
DPRINTF(E_WARN, L_METADATA, "Premature EOF on %s\n", path);
|
|
||||||
fclose (oggfile);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
fclose (oggfile);
|
|
||||||
|
|
||||||
if (memcmp (&oggtestbuf[28], "\x01vorbis", 7))
|
|
||||||
m.mime = strdup ("audio/ogg");
|
|
||||||
else
|
|
||||||
m.mime = strdup ("audio/ogg; codecs=vorbis");
|
|
||||||
|
|
||||||
strcpy(type, "ogg");
|
strcpy(type, "ogg");
|
||||||
|
m.mime = strdup("audio/ogg");
|
||||||
}
|
}
|
||||||
else if ( ends_with(path, ".opus") )
|
|
||||||
{
|
|
||||||
strcpy(type,"ops");
|
|
||||||
m.mime = strdup("audio/ogg; codecs=opus");
|
|
||||||
}
|
|
||||||
#if 0
|
|
||||||
/* Not supported yet, and probably won't be. */
|
|
||||||
else if( ends_with(path, ".ogx") )
|
|
||||||
{
|
|
||||||
strcpy(type, "ogx");
|
|
||||||
m.mime = strdup("application/ogg");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
else if( ends_with(path, ".pcm") )
|
else if( ends_with(path, ".pcm") )
|
||||||
{
|
{
|
||||||
strcpy(type, "pcm");
|
strcpy(type, "pcm");
|
||||||
|
@ -1,59 +0,0 @@
|
|||||||
//=========================================================================
|
|
||||||
// FILENAME : tagutils-opus.c
|
|
||||||
// DESCRIPTION : Opus metadata reader
|
|
||||||
//=========================================================================
|
|
||||||
|
|
||||||
static int
|
|
||||||
_get_opusfileinfo(char *filename, struct song_metadata *psong)
|
|
||||||
{
|
|
||||||
OggOpusFile *opusfile;
|
|
||||||
const OpusTags *tags;
|
|
||||||
char **comment;
|
|
||||||
int *commentlen;
|
|
||||||
int j, e;
|
|
||||||
|
|
||||||
|
|
||||||
opusfile = op_open_file (filename, &e);
|
|
||||||
if(!opusfile)
|
|
||||||
{
|
|
||||||
DPRINTF(E_WARN, L_SCANNER,
|
|
||||||
"Error opening input file \"%s\": %s\n", filename, opus_strerror(e));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
DPRINTF(E_MAXDEBUG, L_SCANNER, "Processing file \"%s\"...\n", filename);
|
|
||||||
|
|
||||||
psong->song_length = op_pcm_total (opusfile, -1);
|
|
||||||
if (psong->song_length < 0)
|
|
||||||
{
|
|
||||||
DPRINTF(E_WARN, L_SCANNER,
|
|
||||||
"Unable to obtain length of %s\n", filename);
|
|
||||||
psong->song_length = 0;
|
|
||||||
} else
|
|
||||||
/* Sample rate is always 48k, so length in ms is just samples/48 */
|
|
||||||
psong->song_length /= 48;
|
|
||||||
|
|
||||||
/* Note that this gives only the first link's channel count. */
|
|
||||||
psong->channels = op_channel_count (opusfile, -1);
|
|
||||||
|
|
||||||
psong->samplerate = 48000;
|
|
||||||
psong->bitrate = op_bitrate (opusfile, -1);
|
|
||||||
|
|
||||||
tags = op_tags (opusfile, -1);
|
|
||||||
|
|
||||||
if (!tags)
|
|
||||||
{
|
|
||||||
DPRINTF(E_WARN, L_SCANNER, "Unable to obtain tags from %s\n",
|
|
||||||
filename);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
comment = tags->user_comments;
|
|
||||||
commentlen = tags->comment_lengths;
|
|
||||||
|
|
||||||
for (j = 0; j < tags->comments; j++)
|
|
||||||
vc_scan (psong, *(comment++), *(commentlen++));
|
|
||||||
|
|
||||||
op_free (opusfile);
|
|
||||||
return 0;
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
//=========================================================================
|
|
||||||
// FILENAME : tagutils-opus.h
|
|
||||||
// DESCRIPTION : Opus metadata reader
|
|
||||||
//=========================================================================
|
|
||||||
|
|
||||||
static int _get_opusfileinfo(char *filename, struct song_metadata *psong);
|
|
@ -42,10 +42,6 @@
|
|||||||
#ifdef HAVE_ICONV
|
#ifdef HAVE_ICONV
|
||||||
#include <iconv.h>
|
#include <iconv.h>
|
||||||
#endif
|
#endif
|
||||||
/* ADD THIS INCLUDE FOR OPUS */
|
|
||||||
#ifdef HAVE_OPUS
|
|
||||||
#include <opusfile.h>
|
|
||||||
#endif
|
|
||||||
#include <sqlite3.h>
|
#include <sqlite3.h>
|
||||||
#include "tagutils.h"
|
#include "tagutils.h"
|
||||||
#include "../metadata.h"
|
#include "../metadata.h"
|
||||||
@ -108,9 +104,8 @@ char *winamp_genre[] = {
|
|||||||
*/
|
*/
|
||||||
#include "tagutils-mp3.h"
|
#include "tagutils-mp3.h"
|
||||||
#include "tagutils-aac.h"
|
#include "tagutils-aac.h"
|
||||||
|
#ifdef HAVE_VORBISFILE
|
||||||
#include "tagutils-ogg.h"
|
#include "tagutils-ogg.h"
|
||||||
#ifdef HAVE_OPUS
|
|
||||||
#include "tagutils-opus.h"
|
|
||||||
#endif
|
#endif
|
||||||
#include "tagutils-flc.h"
|
#include "tagutils-flc.h"
|
||||||
#include "tagutils-asf.h"
|
#include "tagutils-asf.h"
|
||||||
@ -137,15 +132,14 @@ static taghandler taghandlers[] = {
|
|||||||
{ "aac", _get_aactags, _get_aacfileinfo },
|
{ "aac", _get_aactags, _get_aacfileinfo },
|
||||||
{ "mp3", _get_mp3tags, _get_mp3fileinfo },
|
{ "mp3", _get_mp3tags, _get_mp3fileinfo },
|
||||||
{ "flc", _get_flctags, _get_flcfileinfo },
|
{ "flc", _get_flctags, _get_flcfileinfo },
|
||||||
{ "ogg", 0, _get_oggfileinfo },
|
#ifdef HAVE_VORBISFILE
|
||||||
#ifdef HAVE_OPUS
|
{ "ogg", NULL, _get_oggfileinfo },
|
||||||
{ "ops", 0, _get_opusfileinfo },
|
|
||||||
#endif
|
#endif
|
||||||
{ "asf", 0, _get_asffileinfo },
|
{ "asf", NULL, _get_asffileinfo },
|
||||||
{ "wav", _get_wavtags, _get_wavfileinfo },
|
{ "wav", _get_wavtags, _get_wavfileinfo },
|
||||||
{ "pcm", 0, _get_pcmfileinfo },
|
{ "pcm", NULL, _get_pcmfileinfo },
|
||||||
{ "dsf", _get_dsftags, _get_dsffileinfo },
|
{ "dsf", _get_dsftags, _get_dsffileinfo },
|
||||||
{ "dff", 0, _get_dfffileinfo },
|
{ "dff", NULL, _get_dfffileinfo },
|
||||||
{ NULL, NULL, NULL }
|
{ NULL, NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -155,9 +149,8 @@ static taghandler taghandlers[] = {
|
|||||||
#include "tagutils-misc.c"
|
#include "tagutils-misc.c"
|
||||||
#include "tagutils-mp3.c"
|
#include "tagutils-mp3.c"
|
||||||
#include "tagutils-aac.c"
|
#include "tagutils-aac.c"
|
||||||
|
#ifdef HAVE_VORBISFILE
|
||||||
#include "tagutils-ogg.c"
|
#include "tagutils-ogg.c"
|
||||||
#ifdef HAVE_OPUS
|
|
||||||
#include "tagutils-opus.c"
|
|
||||||
#endif
|
#endif
|
||||||
#include "tagutils-flc.c"
|
#include "tagutils-flc.c"
|
||||||
#include "tagutils-asf.c"
|
#include "tagutils-asf.c"
|
||||||
|
16
utils.c
16
utils.c
@ -345,15 +345,8 @@ mime_to_ext(const char * mime)
|
|||||||
return "pcm";
|
return "pcm";
|
||||||
else if( strcmp(mime+6, "3gpp") == 0 )
|
else if( strcmp(mime+6, "3gpp") == 0 )
|
||||||
return "3gp";
|
return "3gp";
|
||||||
else if( strncmp(mime+6, "ogg", 3) == 0 )
|
else if( strcmp(mime, "application/ogg") == 0 )
|
||||||
{
|
|
||||||
if( strstr(mime+9, "opus" ) != (char *)NULL )
|
|
||||||
return "opus";
|
|
||||||
else if( strstr (mime+9, "vorbis" ) != (char *)NULL )
|
|
||||||
return "ogg";
|
return "ogg";
|
||||||
|
|
||||||
return "oga";
|
|
||||||
}
|
|
||||||
else if( strcmp(mime+6, "x-dsd") == 0 )
|
else if( strcmp(mime+6, "x-dsd") == 0 )
|
||||||
return "dsd";
|
return "dsd";
|
||||||
break;
|
break;
|
||||||
@ -384,8 +377,6 @@ mime_to_ext(const char * mime)
|
|||||||
return "3gp";
|
return "3gp";
|
||||||
else if( strncmp(mime+6, "x-tivo-mpeg", 11) == 0 )
|
else if( strncmp(mime+6, "x-tivo-mpeg", 11) == 0 )
|
||||||
return "TiVo";
|
return "TiVo";
|
||||||
else if ( strcmp(mime+6, "ogg") == 0 )
|
|
||||||
return "ogv";
|
|
||||||
break;
|
break;
|
||||||
case 'i':
|
case 'i':
|
||||||
if( strcmp(mime+6, "jpeg") == 0 )
|
if( strcmp(mime+6, "jpeg") == 0 )
|
||||||
@ -410,7 +401,6 @@ is_video(const char * file)
|
|||||||
ends_with(file, ".m2t") || ends_with(file, ".mkv") ||
|
ends_with(file, ".m2t") || ends_with(file, ".mkv") ||
|
||||||
ends_with(file, ".vob") || ends_with(file, ".ts") ||
|
ends_with(file, ".vob") || ends_with(file, ".ts") ||
|
||||||
ends_with(file, ".flv") || ends_with(file, ".xvid") ||
|
ends_with(file, ".flv") || ends_with(file, ".xvid") ||
|
||||||
ends_with(file, ".ogv") ||
|
|
||||||
#ifdef TIVO_SUPPORT
|
#ifdef TIVO_SUPPORT
|
||||||
ends_with(file, ".TiVo") ||
|
ends_with(file, ".TiVo") ||
|
||||||
#endif
|
#endif
|
||||||
@ -428,10 +418,6 @@ is_audio(const char * file)
|
|||||||
ends_with(file, ".m4a") || ends_with(file, ".aac") ||
|
ends_with(file, ".m4a") || ends_with(file, ".aac") ||
|
||||||
ends_with(file, ".mp4") || ends_with(file, ".m4p") ||
|
ends_with(file, ".mp4") || ends_with(file, ".m4p") ||
|
||||||
ends_with(file, ".wav") || ends_with(file, ".ogg") ||
|
ends_with(file, ".wav") || ends_with(file, ".ogg") ||
|
||||||
ends_with(file, ".oga") ||
|
|
||||||
#ifdef HAVE_OPUS
|
|
||||||
ends_with(file, ".opus") ||
|
|
||||||
#endif
|
|
||||||
ends_with(file, ".pcm") || ends_with(file, ".3gp") ||
|
ends_with(file, ".pcm") || ends_with(file, ".3gp") ||
|
||||||
ends_with(file, ".dsf") || ends_with(file, ".dff"));
|
ends_with(file, ".dsf") || ends_with(file, ".dff"));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user