Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
d0556dc9
Commit
d0556dc9
authored
Aug 29, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tag: renamed MpdTag and MpdTagItem to struct tag, struct mpd_tag_item
Getting rid of CamelCase; not having typedefs also allows us to forward-declare the structures.
parent
f42de62a
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
93 additions
and
90 deletions
+93
-90
audio.c
src/audio.c
+1
-1
audio.h
src/audio.h
+1
-1
audioOutput.c
src/audioOutput.c
+2
-1
audioOutput.h
src/audioOutput.h
+3
-2
audioOutput_shout.c
src/audioOutputs/audioOutput_shout.c
+2
-2
dbUtils.c
src/dbUtils.c
+1
-1
decoder_api.h
src/decoder_api.h
+1
-1
_flac_common.c
src/inputPlugins/_flac_common.c
+3
-3
_flac_common.h
src/inputPlugins/_flac_common.h
+3
-3
aac_plugin.c
src/inputPlugins/aac_plugin.c
+2
-2
audiofile_plugin.c
src/inputPlugins/audiofile_plugin.c
+2
-2
flac_plugin.c
src/inputPlugins/flac_plugin.c
+7
-7
mod_plugin.c
src/inputPlugins/mod_plugin.c
+2
-2
mp3_plugin.c
src/inputPlugins/mp3_plugin.c
+9
-9
mp4_plugin.c
src/inputPlugins/mp4_plugin.c
+5
-5
mpc_plugin.c
src/inputPlugins/mpc_plugin.c
+2
-2
oggvorbis_plugin.c
src/inputPlugins/oggvorbis_plugin.c
+6
-6
wavpack_plugin.c
src/inputPlugins/wavpack_plugin.c
+2
-2
song.h
src/song.h
+1
-1
tag.c
src/tag.c
+23
-22
tag.h
src/tag.h
+15
-15
No files found.
src/audio.c
View file @
d0556dc9
...
@@ -419,7 +419,7 @@ void closeAudioDevice(void)
...
@@ -419,7 +419,7 @@ void closeAudioDevice(void)
audioOpened
=
0
;
audioOpened
=
0
;
}
}
void
sendMetadataToAudioDevice
(
const
MpdTag
*
tag
)
void
sendMetadataToAudioDevice
(
const
struct
tag
*
tag
)
{
{
unsigned
int
i
;
unsigned
int
i
;
...
...
src/audio.h
View file @
d0556dc9
...
@@ -55,7 +55,7 @@ int isAudioDeviceOpen(void);
...
@@ -55,7 +55,7 @@ int isAudioDeviceOpen(void);
int
isCurrentAudioFormat
(
const
AudioFormat
*
audioFormat
);
int
isCurrentAudioFormat
(
const
AudioFormat
*
audioFormat
);
void
sendMetadataToAudioDevice
(
const
MpdTag
*
tag
);
void
sendMetadataToAudioDevice
(
const
struct
tag
*
tag
);
/* these functions are called in the main parent process while the child
/* these functions are called in the main parent process while the child
process is busy playing to the audio */
process is busy playing to the audio */
...
...
src/audioOutput.c
View file @
d0556dc9
...
@@ -244,7 +244,8 @@ void finishAudioOutput(AudioOutput * audioOutput)
...
@@ -244,7 +244,8 @@ void finishAudioOutput(AudioOutput * audioOutput)
free
(
audioOutput
->
convBuffer
);
free
(
audioOutput
->
convBuffer
);
}
}
void
sendMetadataToAudioOutput
(
AudioOutput
*
audioOutput
,
const
MpdTag
*
tag
)
void
sendMetadataToAudioOutput
(
AudioOutput
*
audioOutput
,
const
struct
tag
*
tag
)
{
{
if
(
!
audioOutput
->
sendMetdataFunc
)
if
(
!
audioOutput
->
sendMetdataFunc
)
return
;
return
;
...
...
src/audioOutput.h
View file @
d0556dc9
...
@@ -50,7 +50,7 @@ typedef void (*AudioOutputDropBufferedAudioFunc) (AudioOutput * audioOutput);
...
@@ -50,7 +50,7 @@ typedef void (*AudioOutputDropBufferedAudioFunc) (AudioOutput * audioOutput);
typedef
void
(
*
AudioOutputCloseDeviceFunc
)
(
AudioOutput
*
audioOutput
);
typedef
void
(
*
AudioOutputCloseDeviceFunc
)
(
AudioOutput
*
audioOutput
);
typedef
void
(
*
AudioOutputSendMetadataFunc
)
(
AudioOutput
*
audioOutput
,
typedef
void
(
*
AudioOutputSendMetadataFunc
)
(
AudioOutput
*
audioOutput
,
const
MpdTag
*
tag
);
const
struct
tag
*
tag
);
struct
_AudioOutput
{
struct
_AudioOutput
{
int
open
;
int
open
;
...
@@ -104,7 +104,8 @@ void dropBufferedAudioOutput(AudioOutput * audioOutput);
...
@@ -104,7 +104,8 @@ void dropBufferedAudioOutput(AudioOutput * audioOutput);
void
closeAudioOutput
(
AudioOutput
*
audioOutput
);
void
closeAudioOutput
(
AudioOutput
*
audioOutput
);
void
finishAudioOutput
(
AudioOutput
*
audioOutput
);
void
finishAudioOutput
(
AudioOutput
*
audioOutput
);
int
keepAudioOutputAlive
(
AudioOutput
*
audioOutput
,
int
ms
);
int
keepAudioOutputAlive
(
AudioOutput
*
audioOutput
,
int
ms
);
void
sendMetadataToAudioOutput
(
AudioOutput
*
audioOutput
,
const
MpdTag
*
tag
);
void
sendMetadataToAudioOutput
(
AudioOutput
*
audioOutput
,
const
struct
tag
*
tag
);
void
printAllOutputPluginTypes
(
FILE
*
fp
);
void
printAllOutputPluginTypes
(
FILE
*
fp
);
...
...
src/audioOutputs/audioOutput_shout.c
View file @
d0556dc9
...
@@ -56,7 +56,7 @@ typedef struct _ShoutData {
...
@@ -56,7 +56,7 @@ typedef struct _ShoutData {
int
opened
;
int
opened
;
MpdT
ag
*
tag
;
struct
t
ag
*
tag
;
int
tagToSend
;
int
tagToSend
;
int
timeout
;
int
timeout
;
...
@@ -663,7 +663,7 @@ static int myShout_play(AudioOutput * audioOutput,
...
@@ -663,7 +663,7 @@ static int myShout_play(AudioOutput * audioOutput,
return
0
;
return
0
;
}
}
static
void
myShout_setTag
(
AudioOutput
*
audioOutput
,
MpdTag
*
tag
)
static
void
myShout_setTag
(
AudioOutput
*
audioOutput
,
struct
tag
*
tag
)
{
{
ShoutData
*
sd
=
(
ShoutData
*
)
audioOutput
->
data
;
ShoutData
*
sd
=
(
ShoutData
*
)
audioOutput
->
data
;
...
...
src/dbUtils.c
View file @
d0556dc9
...
@@ -257,7 +257,7 @@ static void freeListCommandItem(ListCommandItem * item)
...
@@ -257,7 +257,7 @@ static void freeListCommandItem(ListCommandItem * item)
static
void
visitTag
(
int
fd
,
Song
*
song
,
enum
tag_type
tagType
)
static
void
visitTag
(
int
fd
,
Song
*
song
,
enum
tag_type
tagType
)
{
{
int
i
;
int
i
;
MpdT
ag
*
tag
=
song
->
tag
;
struct
t
ag
*
tag
=
song
->
tag
;
if
(
tagType
==
LOCATE_TAG_FILE_TYPE
)
{
if
(
tagType
==
LOCATE_TAG_FILE_TYPE
)
{
printSongUrl
(
fd
,
song
);
printSongUrl
(
fd
,
song
);
...
...
src/decoder_api.h
View file @
d0556dc9
...
@@ -74,7 +74,7 @@ typedef int (*decoder_file_decode_func) (struct decoder *, char *path);
...
@@ -74,7 +74,7 @@ typedef int (*decoder_file_decode_func) (struct decoder *, char *path);
/* file should be the full path! Returns NULL if a tag cannot be found
/* file should be the full path! Returns NULL if a tag cannot be found
* or read */
* or read */
typedef
MpdT
ag
*
(
*
decoder_tag_dup_func
)
(
char
*
file
);
typedef
struct
t
ag
*
(
*
decoder_tag_dup_func
)
(
char
*
file
);
struct
decoder_plugin
{
struct
decoder_plugin
{
const
char
*
name
;
const
char
*
name
;
...
...
src/inputPlugins/_flac_common.c
View file @
d0556dc9
...
@@ -103,7 +103,7 @@ static const char *VORBIS_COMMENT_DISC_KEY = "discnumber";
...
@@ -103,7 +103,7 @@ static const char *VORBIS_COMMENT_DISC_KEY = "discnumber";
static
unsigned
int
commentMatchesAddToTag
(
const
static
unsigned
int
commentMatchesAddToTag
(
const
FLAC__StreamMetadata_VorbisComment_Entry
FLAC__StreamMetadata_VorbisComment_Entry
*
entry
,
unsigned
int
itemType
,
*
entry
,
unsigned
int
itemType
,
MpdT
ag
**
tag
)
struct
t
ag
**
tag
)
{
{
const
char
*
str
;
const
char
*
str
;
size_t
slen
;
size_t
slen
;
...
@@ -136,8 +136,8 @@ static unsigned int commentMatchesAddToTag(const
...
@@ -136,8 +136,8 @@ static unsigned int commentMatchesAddToTag(const
return
0
;
return
0
;
}
}
MpdT
ag
*
copyVorbisCommentBlockToMpdTag
(
const
FLAC__StreamMetadata
*
block
,
struct
t
ag
*
copyVorbisCommentBlockToMpdTag
(
const
FLAC__StreamMetadata
*
block
,
MpdT
ag
*
tag
)
struct
t
ag
*
tag
)
{
{
unsigned
int
i
,
j
;
unsigned
int
i
,
j
;
FLAC__StreamMetadata_VorbisComment_Entry
*
comments
;
FLAC__StreamMetadata_VorbisComment_Entry
*
comments
;
...
...
src/inputPlugins/_flac_common.h
View file @
d0556dc9
...
@@ -149,7 +149,7 @@ typedef struct {
...
@@ -149,7 +149,7 @@ typedef struct {
struct
decoder
*
decoder
;
struct
decoder
*
decoder
;
InputStream
*
inStream
;
InputStream
*
inStream
;
ReplayGainInfo
*
replayGainInfo
;
ReplayGainInfo
*
replayGainInfo
;
MpdT
ag
*
tag
;
struct
t
ag
*
tag
;
}
FlacData
;
}
FlacData
;
/* initializes a given FlacData struct */
/* initializes a given FlacData struct */
...
@@ -161,8 +161,8 @@ void flac_error_common_cb(const char *plugin,
...
@@ -161,8 +161,8 @@ void flac_error_common_cb(const char *plugin,
FLAC__StreamDecoderErrorStatus
status
,
FLAC__StreamDecoderErrorStatus
status
,
FlacData
*
data
);
FlacData
*
data
);
MpdT
ag
*
copyVorbisCommentBlockToMpdTag
(
const
FLAC__StreamMetadata
*
block
,
struct
t
ag
*
copyVorbisCommentBlockToMpdTag
(
const
FLAC__StreamMetadata
*
block
,
MpdTag
*
tag
);
struct
tag
*
tag
);
/* keep this inlined, this is just macro but prettier :) */
/* keep this inlined, this is just macro but prettier :) */
static
inline
int
flacSendChunk
(
FlacData
*
data
)
static
inline
int
flacSendChunk
(
FlacData
*
data
)
...
...
src/inputPlugins/aac_plugin.c
View file @
d0556dc9
...
@@ -572,9 +572,9 @@ static int aac_decode(struct decoder * mpd_decoder, char *path)
...
@@ -572,9 +572,9 @@ static int aac_decode(struct decoder * mpd_decoder, char *path)
return
0
;
return
0
;
}
}
static
MpdT
ag
*
aacTagDup
(
char
*
file
)
static
struct
t
ag
*
aacTagDup
(
char
*
file
)
{
{
MpdT
ag
*
ret
=
NULL
;
struct
t
ag
*
ret
=
NULL
;
int
file_time
=
getAacTotalTime
(
file
);
int
file_time
=
getAacTotalTime
(
file
);
if
(
file_time
>=
0
)
{
if
(
file_time
>=
0
)
{
...
...
src/inputPlugins/audiofile_plugin.c
View file @
d0556dc9
...
@@ -120,9 +120,9 @@ static int audiofile_decode(struct decoder * decoder, char *path)
...
@@ -120,9 +120,9 @@ static int audiofile_decode(struct decoder * decoder, char *path)
return
0
;
return
0
;
}
}
static
MpdT
ag
*
audiofileTagDup
(
char
*
file
)
static
struct
t
ag
*
audiofileTagDup
(
char
*
file
)
{
{
MpdT
ag
*
ret
=
NULL
;
struct
t
ag
*
ret
=
NULL
;
int
total_time
=
getAudiofileTotalTime
(
file
);
int
total_time
=
getAudiofileTotalTime
(
file
);
if
(
total_time
>=
0
)
{
if
(
total_time
>=
0
)
{
...
...
src/inputPlugins/flac_plugin.c
View file @
d0556dc9
...
@@ -290,9 +290,9 @@ static FLAC__StreamDecoderWriteStatus flacWrite(const flac_decoder *dec,
...
@@ -290,9 +290,9 @@ static FLAC__StreamDecoderWriteStatus flacWrite(const flac_decoder *dec,
return
FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE
;
return
FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE
;
}
}
static
MpdT
ag
*
flacMetadataDup
(
char
*
file
,
int
*
vorbisCommentFound
)
static
struct
t
ag
*
flacMetadataDup
(
char
*
file
,
int
*
vorbisCommentFound
)
{
{
MpdT
ag
*
ret
=
NULL
;
struct
t
ag
*
ret
=
NULL
;
FLAC__Metadata_SimpleIterator
*
it
;
FLAC__Metadata_SimpleIterator
*
it
;
FLAC__StreamMetadata
*
block
=
NULL
;
FLAC__StreamMetadata
*
block
=
NULL
;
...
@@ -348,9 +348,9 @@ static MpdTag *flacMetadataDup(char *file, int *vorbisCommentFound)
...
@@ -348,9 +348,9 @@ static MpdTag *flacMetadataDup(char *file, int *vorbisCommentFound)
return
ret
;
return
ret
;
}
}
static
MpdT
ag
*
flacTagDup
(
char
*
file
)
static
struct
t
ag
*
flacTagDup
(
char
*
file
)
{
{
MpdT
ag
*
ret
=
NULL
;
struct
t
ag
*
ret
=
NULL
;
int
foundVorbisComment
=
0
;
int
foundVorbisComment
=
0
;
ret
=
flacMetadataDup
(
file
,
&
foundVorbisComment
);
ret
=
flacMetadataDup
(
file
,
&
foundVorbisComment
);
...
@@ -360,7 +360,7 @@ static MpdTag *flacTagDup(char *file)
...
@@ -360,7 +360,7 @@ static MpdTag *flacTagDup(char *file)
return
NULL
;
return
NULL
;
}
}
if
(
!
foundVorbisComment
)
{
if
(
!
foundVorbisComment
)
{
MpdT
ag
*
temp
=
id3Dup
(
file
);
struct
t
ag
*
temp
=
id3Dup
(
file
);
if
(
temp
)
{
if
(
temp
)
{
temp
->
time
=
ret
->
time
;
temp
->
time
=
ret
->
time
;
freeMpdTag
(
ret
);
freeMpdTag
(
ret
);
...
@@ -464,9 +464,9 @@ static int flac_decode(struct decoder * decoder, InputStream * inStream)
...
@@ -464,9 +464,9 @@ static int flac_decode(struct decoder * decoder, InputStream * inStream)
/* some of this stuff is duplicated from oggflac_plugin.c */
/* some of this stuff is duplicated from oggflac_plugin.c */
extern
struct
decoder_plugin
oggflacPlugin
;
extern
struct
decoder_plugin
oggflacPlugin
;
static
MpdT
ag
*
oggflac_tag_dup
(
char
*
file
)
static
struct
t
ag
*
oggflac_tag_dup
(
char
*
file
)
{
{
MpdT
ag
*
ret
=
NULL
;
struct
t
ag
*
ret
=
NULL
;
FLAC__Metadata_Iterator
*
it
;
FLAC__Metadata_Iterator
*
it
;
FLAC__StreamMetadata
*
block
;
FLAC__StreamMetadata
*
block
;
FLAC__Metadata_Chain
*
chain
=
FLAC__metadata_chain_new
();
FLAC__Metadata_Chain
*
chain
=
FLAC__metadata_chain_new
();
...
...
src/inputPlugins/mod_plugin.c
View file @
d0556dc9
...
@@ -213,9 +213,9 @@ static int mod_decode(struct decoder * decoder, char *path)
...
@@ -213,9 +213,9 @@ static int mod_decode(struct decoder * decoder, char *path)
return
0
;
return
0
;
}
}
static
MpdT
ag
*
modTagDup
(
char
*
file
)
static
struct
t
ag
*
modTagDup
(
char
*
file
)
{
{
MpdT
ag
*
ret
=
NULL
;
struct
t
ag
*
ret
=
NULL
;
MODULE
*
moduleHandle
;
MODULE
*
moduleHandle
;
char
*
title
;
char
*
title
;
...
...
src/inputPlugins/mp3_plugin.c
View file @
d0556dc9
...
@@ -299,13 +299,13 @@ static ReplayGainInfo *parseId3ReplayGainInfo(struct id3_tag *tag)
...
@@ -299,13 +299,13 @@ static ReplayGainInfo *parseId3ReplayGainInfo(struct id3_tag *tag)
#ifdef HAVE_ID3TAG
#ifdef HAVE_ID3TAG
static
void
mp3_parseId3Tag
(
mp3DecodeData
*
data
,
size_t
tagsize
,
static
void
mp3_parseId3Tag
(
mp3DecodeData
*
data
,
size_t
tagsize
,
MpdT
ag
**
mpdTag
,
ReplayGainInfo
**
replayGainInfo
)
struct
t
ag
**
mpdTag
,
ReplayGainInfo
**
replayGainInfo
)
{
{
struct
id3_tag
*
id3Tag
=
NULL
;
struct
id3_tag
*
id3Tag
=
NULL
;
id3_length_t
count
;
id3_length_t
count
;
id3_byte_t
const
*
id3_data
;
id3_byte_t
const
*
id3_data
;
id3_byte_t
*
allocated
=
NULL
;
id3_byte_t
*
allocated
=
NULL
;
MpdT
ag
*
tmpMpdTag
;
struct
t
ag
*
tmpMpdTag
;
ReplayGainInfo
*
tmpReplayGainInfo
;
ReplayGainInfo
*
tmpReplayGainInfo
;
count
=
data
->
stream
.
bufend
-
data
->
stream
.
this_frame
;
count
=
data
->
stream
.
bufend
-
data
->
stream
.
this_frame
;
...
@@ -370,7 +370,7 @@ fail:
...
@@ -370,7 +370,7 @@ fail:
#endif
#endif
static
enum
mp3_action
static
enum
mp3_action
decodeNextFrameHeader
(
mp3DecodeData
*
data
,
MpdT
ag
**
tag
,
decodeNextFrameHeader
(
mp3DecodeData
*
data
,
struct
t
ag
**
tag
,
ReplayGainInfo
**
replayGainInfo
)
ReplayGainInfo
**
replayGainInfo
)
{
{
enum
mad_layer
layer
;
enum
mad_layer
layer
;
...
@@ -685,7 +685,7 @@ static int parse_lame(struct lame *lame, struct mad_bitptr *ptr, int *bitlen)
...
@@ -685,7 +685,7 @@ static int parse_lame(struct lame *lame, struct mad_bitptr *ptr, int *bitlen)
}
}
static
int
decodeFirstFrame
(
mp3DecodeData
*
data
,
static
int
decodeFirstFrame
(
mp3DecodeData
*
data
,
MpdT
ag
**
tag
,
ReplayGainInfo
**
replayGainInfo
)
struct
t
ag
**
tag
,
ReplayGainInfo
**
replayGainInfo
)
{
{
struct
decoder
*
decoder
=
data
->
decoder
;
struct
decoder
*
decoder
=
data
->
decoder
;
struct
xing
xing
;
struct
xing
xing
;
...
@@ -813,7 +813,7 @@ static int getMp3TotalTime(char *file)
...
@@ -813,7 +813,7 @@ static int getMp3TotalTime(char *file)
}
}
static
int
openMp3FromInputStream
(
InputStream
*
inStream
,
mp3DecodeData
*
data
,
static
int
openMp3FromInputStream
(
InputStream
*
inStream
,
mp3DecodeData
*
data
,
struct
decoder
*
decoder
,
MpdT
ag
**
tag
,
struct
decoder
*
decoder
,
struct
t
ag
**
tag
,
ReplayGainInfo
**
replayGainInfo
)
ReplayGainInfo
**
replayGainInfo
)
{
{
initMp3DecodeData
(
data
,
decoder
,
inStream
);
initMp3DecodeData
(
data
,
decoder
,
inStream
);
...
@@ -896,7 +896,7 @@ mp3Read(mp3DecodeData * data, ReplayGainInfo ** replayGainInfo)
...
@@ -896,7 +896,7 @@ mp3Read(mp3DecodeData * data, ReplayGainInfo ** replayGainInfo)
}
}
if
(
data
->
inStream
->
metaTitle
)
{
if
(
data
->
inStream
->
metaTitle
)
{
MpdT
ag
*
tag
=
newMpdTag
();
struct
t
ag
*
tag
=
newMpdTag
();
if
(
data
->
inStream
->
metaName
)
{
if
(
data
->
inStream
->
metaName
)
{
addItemToMpdTag
(
tag
,
addItemToMpdTag
(
tag
,
TAG_ITEM_NAME
,
TAG_ITEM_NAME
,
...
@@ -1032,7 +1032,7 @@ static void initAudioFormatFromMp3DecodeData(mp3DecodeData * data,
...
@@ -1032,7 +1032,7 @@ static void initAudioFormatFromMp3DecodeData(mp3DecodeData * data,
static
int
mp3_decode
(
struct
decoder
*
decoder
,
InputStream
*
inStream
)
static
int
mp3_decode
(
struct
decoder
*
decoder
,
InputStream
*
inStream
)
{
{
mp3DecodeData
data
;
mp3DecodeData
data
;
MpdT
ag
*
tag
=
NULL
;
struct
t
ag
*
tag
=
NULL
;
ReplayGainInfo
*
replayGainInfo
=
NULL
;
ReplayGainInfo
*
replayGainInfo
=
NULL
;
AudioFormat
audio_format
;
AudioFormat
audio_format
;
...
@@ -1092,9 +1092,9 @@ static int mp3_decode(struct decoder * decoder, InputStream * inStream)
...
@@ -1092,9 +1092,9 @@ static int mp3_decode(struct decoder * decoder, InputStream * inStream)
return
0
;
return
0
;
}
}
static
MpdT
ag
*
mp3_tagDup
(
char
*
file
)
static
struct
t
ag
*
mp3_tagDup
(
char
*
file
)
{
{
MpdT
ag
*
ret
=
NULL
;
struct
t
ag
*
ret
=
NULL
;
int
total_time
;
int
total_time
;
ret
=
id3Dup
(
file
);
ret
=
id3Dup
(
file
);
...
...
src/inputPlugins/mp4_plugin.c
View file @
d0556dc9
...
@@ -296,9 +296,9 @@ static int mp4_decode(struct decoder * mpd_decoder, InputStream * inStream)
...
@@ -296,9 +296,9 @@ static int mp4_decode(struct decoder * mpd_decoder, InputStream * inStream)
return
0
;
return
0
;
}
}
static
MpdT
ag
*
mp4DataDup
(
char
*
file
,
int
*
mp4MetadataFound
)
static
struct
t
ag
*
mp4DataDup
(
char
*
file
,
int
*
mp4MetadataFound
)
{
{
MpdT
ag
*
ret
=
NULL
;
struct
t
ag
*
ret
=
NULL
;
InputStream
inStream
;
InputStream
inStream
;
mp4ff_t
*
mp4fh
;
mp4ff_t
*
mp4fh
;
mp4ff_callback_t
*
callback
;
mp4ff_callback_t
*
callback
;
...
@@ -385,16 +385,16 @@ static MpdTag *mp4DataDup(char *file, int *mp4MetadataFound)
...
@@ -385,16 +385,16 @@ static MpdTag *mp4DataDup(char *file, int *mp4MetadataFound)
return
ret
;
return
ret
;
}
}
static
MpdT
ag
*
mp4TagDup
(
char
*
file
)
static
struct
t
ag
*
mp4TagDup
(
char
*
file
)
{
{
MpdT
ag
*
ret
=
NULL
;
struct
t
ag
*
ret
=
NULL
;
int
mp4MetadataFound
=
0
;
int
mp4MetadataFound
=
0
;
ret
=
mp4DataDup
(
file
,
&
mp4MetadataFound
);
ret
=
mp4DataDup
(
file
,
&
mp4MetadataFound
);
if
(
!
ret
)
if
(
!
ret
)
return
NULL
;
return
NULL
;
if
(
!
mp4MetadataFound
)
{
if
(
!
mp4MetadataFound
)
{
MpdT
ag
*
temp
=
id3Dup
(
file
);
struct
t
ag
*
temp
=
id3Dup
(
file
);
if
(
temp
)
{
if
(
temp
)
{
temp
->
time
=
ret
->
time
;
temp
->
time
=
ret
->
time
;
freeMpdTag
(
ret
);
freeMpdTag
(
ret
);
...
...
src/inputPlugins/mpc_plugin.c
View file @
d0556dc9
...
@@ -279,9 +279,9 @@ static float mpcGetTime(char *file)
...
@@ -279,9 +279,9 @@ static float mpcGetTime(char *file)
return
total_time
;
return
total_time
;
}
}
static
MpdT
ag
*
mpcTagDup
(
char
*
file
)
static
struct
t
ag
*
mpcTagDup
(
char
*
file
)
{
{
MpdT
ag
*
ret
=
NULL
;
struct
t
ag
*
ret
=
NULL
;
float
total_time
=
mpcGetTime
(
file
);
float
total_time
=
mpcGetTime
(
file
);
if
(
total_time
<
0
)
{
if
(
total_time
<
0
)
{
...
...
src/inputPlugins/oggvorbis_plugin.c
View file @
d0556dc9
...
@@ -140,7 +140,7 @@ static const char *VORBIS_COMMENT_DISC_KEY = "discnumber";
...
@@ -140,7 +140,7 @@ static const char *VORBIS_COMMENT_DISC_KEY = "discnumber";
static
unsigned
int
ogg_parseCommentAddToTag
(
char
*
comment
,
static
unsigned
int
ogg_parseCommentAddToTag
(
char
*
comment
,
unsigned
int
itemType
,
unsigned
int
itemType
,
MpdT
ag
**
tag
)
struct
t
ag
**
tag
)
{
{
const
char
*
needle
;
const
char
*
needle
;
unsigned
int
len
;
unsigned
int
len
;
...
@@ -168,9 +168,9 @@ static unsigned int ogg_parseCommentAddToTag(char *comment,
...
@@ -168,9 +168,9 @@ static unsigned int ogg_parseCommentAddToTag(char *comment,
return
0
;
return
0
;
}
}
static
MpdT
ag
*
oggCommentsParse
(
char
**
comments
)
static
struct
t
ag
*
oggCommentsParse
(
char
**
comments
)
{
{
MpdT
ag
*
tag
=
NULL
;
struct
t
ag
*
tag
=
NULL
;
while
(
*
comments
)
{
while
(
*
comments
)
{
int
j
;
int
j
;
...
@@ -187,7 +187,7 @@ static MpdTag *oggCommentsParse(char **comments)
...
@@ -187,7 +187,7 @@ static MpdTag *oggCommentsParse(char **comments)
static
void
putOggCommentsIntoOutputBuffer
(
char
*
streamName
,
static
void
putOggCommentsIntoOutputBuffer
(
char
*
streamName
,
char
**
comments
)
char
**
comments
)
{
{
MpdT
ag
*
tag
;
struct
t
ag
*
tag
;
tag
=
oggCommentsParse
(
comments
);
tag
=
oggCommentsParse
(
comments
);
if
(
!
tag
&&
streamName
)
{
if
(
!
tag
&&
streamName
)
{
...
@@ -337,9 +337,9 @@ static int oggvorbis_decode(struct decoder * decoder, InputStream * inStream)
...
@@ -337,9 +337,9 @@ static int oggvorbis_decode(struct decoder * decoder, InputStream * inStream)
return
0
;
return
0
;
}
}
static
MpdT
ag
*
oggvorbis_TagDup
(
char
*
file
)
static
struct
t
ag
*
oggvorbis_TagDup
(
char
*
file
)
{
{
MpdT
ag
*
ret
;
struct
t
ag
*
ret
;
FILE
*
fp
;
FILE
*
fp
;
OggVorbis_File
vf
;
OggVorbis_File
vf
;
...
...
src/inputPlugins/wavpack_plugin.c
View file @
d0556dc9
...
@@ -281,10 +281,10 @@ static ReplayGainInfo *wavpack_replaygain(WavpackContext *wpc)
...
@@ -281,10 +281,10 @@ static ReplayGainInfo *wavpack_replaygain(WavpackContext *wpc)
/*
/*
* Reads metainfo from the specified file.
* Reads metainfo from the specified file.
*/
*/
static
MpdT
ag
*
wavpack_tagdup
(
char
*
fname
)
static
struct
t
ag
*
wavpack_tagdup
(
char
*
fname
)
{
{
WavpackContext
*
wpc
;
WavpackContext
*
wpc
;
MpdT
ag
*
tag
;
struct
t
ag
*
tag
;
char
error
[
ERRORLEN
];
char
error
[
ERRORLEN
];
char
*
s
;
char
*
s
;
int
ssize
;
int
ssize
;
...
...
src/song.h
View file @
d0556dc9
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
typedef
struct
_Song
{
typedef
struct
_Song
{
char
*
url
;
char
*
url
;
mpd_sint8
type
;
mpd_sint8
type
;
MpdT
ag
*
tag
;
struct
t
ag
*
tag
;
struct
_Directory
*
parentDir
;
struct
_Directory
*
parentDir
;
time_t
mtime
;
time_t
mtime
;
}
Song
;
}
Song
;
...
...
src/tag.c
View file @
d0556dc9
...
@@ -114,7 +114,7 @@ void printTagTypes(int fd)
...
@@ -114,7 +114,7 @@ void printTagTypes(int fd)
}
}
}
}
void
printMpdTag
(
int
fd
,
MpdTag
*
tag
)
void
printMpdTag
(
int
fd
,
struct
tag
*
tag
)
{
{
int
i
;
int
i
;
...
@@ -164,8 +164,8 @@ static id3_utf8_t * processID3FieldString (int is_id3v1, const id3_ucs4_t *ucs4,
...
@@ -164,8 +164,8 @@ static id3_utf8_t * processID3FieldString (int is_id3v1, const id3_ucs4_t *ucs4,
return
utf8
;
return
utf8
;
}
}
static
MpdT
ag
*
getID3Info
(
static
struct
t
ag
*
getID3Info
(
struct
id3_tag
*
tag
,
const
char
*
id
,
int
type
,
MpdTag
*
mpdTag
)
struct
id3_tag
*
tag
,
const
char
*
id
,
int
type
,
struct
tag
*
mpdTag
)
{
{
struct
id3_frame
const
*
frame
;
struct
id3_frame
const
*
frame
;
id3_ucs4_t
const
*
ucs4
;
id3_ucs4_t
const
*
ucs4
;
...
@@ -283,9 +283,9 @@ static MpdTag *getID3Info(
...
@@ -283,9 +283,9 @@ static MpdTag *getID3Info(
#endif
#endif
#ifdef HAVE_ID3TAG
#ifdef HAVE_ID3TAG
MpdT
ag
*
parseId3Tag
(
struct
id3_tag
*
tag
)
struct
t
ag
*
parseId3Tag
(
struct
id3_tag
*
tag
)
{
{
MpdT
ag
*
ret
=
NULL
;
struct
t
ag
*
ret
=
NULL
;
ret
=
getID3Info
(
tag
,
ID3_FRAME_ARTIST
,
TAG_ITEM_ARTIST
,
ret
);
ret
=
getID3Info
(
tag
,
ID3_FRAME_ARTIST
,
TAG_ITEM_ARTIST
,
ret
);
ret
=
getID3Info
(
tag
,
ID3_FRAME_TITLE
,
TAG_ITEM_TITLE
,
ret
);
ret
=
getID3Info
(
tag
,
ID3_FRAME_TITLE
,
TAG_ITEM_TITLE
,
ret
);
...
@@ -425,9 +425,9 @@ static struct id3_tag *findId3TagFromEnd(FILE * stream)
...
@@ -425,9 +425,9 @@ static struct id3_tag *findId3TagFromEnd(FILE * stream)
}
}
#endif
#endif
MpdT
ag
*
id3Dup
(
char
*
file
)
struct
t
ag
*
id3Dup
(
char
*
file
)
{
{
MpdT
ag
*
ret
=
NULL
;
struct
t
ag
*
ret
=
NULL
;
#ifdef HAVE_ID3TAG
#ifdef HAVE_ID3TAG
struct
id3_tag
*
tag
;
struct
id3_tag
*
tag
;
FILE
*
stream
;
FILE
*
stream
;
...
@@ -453,9 +453,9 @@ MpdTag *id3Dup(char *file)
...
@@ -453,9 +453,9 @@ MpdTag *id3Dup(char *file)
return
ret
;
return
ret
;
}
}
MpdT
ag
*
apeDup
(
char
*
file
)
struct
t
ag
*
apeDup
(
char
*
file
)
{
{
MpdT
ag
*
ret
=
NULL
;
struct
t
ag
*
ret
=
NULL
;
FILE
*
fp
;
FILE
*
fp
;
int
tagCount
;
int
tagCount
;
char
*
buffer
=
NULL
;
char
*
buffer
=
NULL
;
...
@@ -574,16 +574,16 @@ fail:
...
@@ -574,16 +574,16 @@ fail:
return
ret
;
return
ret
;
}
}
MpdT
ag
*
newMpdTag
(
void
)
struct
t
ag
*
newMpdTag
(
void
)
{
{
MpdTag
*
ret
=
xmalloc
(
sizeof
(
MpdTag
));
struct
tag
*
ret
=
xmalloc
(
sizeof
(
*
ret
));
ret
->
items
=
NULL
;
ret
->
items
=
NULL
;
ret
->
time
=
-
1
;
ret
->
time
=
-
1
;
ret
->
numOfItems
=
0
;
ret
->
numOfItems
=
0
;
return
ret
;
return
ret
;
}
}
static
void
deleteItem
(
MpdTag
*
tag
,
int
idx
)
static
void
deleteItem
(
struct
tag
*
tag
,
int
idx
)
{
{
assert
(
idx
<
tag
->
numOfItems
);
assert
(
idx
<
tag
->
numOfItems
);
tag
->
numOfItems
--
;
tag
->
numOfItems
--
;
...
@@ -598,14 +598,14 @@ static void deleteItem(MpdTag * tag, int idx)
...
@@ -598,14 +598,14 @@ static void deleteItem(MpdTag * tag, int idx)
if
(
tag
->
numOfItems
>
0
)
{
if
(
tag
->
numOfItems
>
0
)
{
tag
->
items
=
xrealloc
(
tag
->
items
,
tag
->
items
=
xrealloc
(
tag
->
items
,
tag
->
numOfItems
*
sizeof
(
MpdTagItem
));
tag
->
numOfItems
*
sizeof
(
*
tag
->
items
));
}
else
{
}
else
{
free
(
tag
->
items
);
free
(
tag
->
items
);
tag
->
items
=
NULL
;
tag
->
items
=
NULL
;
}
}
}
}
void
clearItemsFromMpdTag
(
MpdTag
*
tag
,
enum
tag_type
type
)
void
clearItemsFromMpdTag
(
struct
tag
*
tag
,
enum
tag_type
type
)
{
{
int
i
;
int
i
;
...
@@ -618,7 +618,7 @@ void clearItemsFromMpdTag(MpdTag * tag, enum tag_type type)
...
@@ -618,7 +618,7 @@ void clearItemsFromMpdTag(MpdTag * tag, enum tag_type type)
}
}
}
}
static
void
clearMpdTag
(
MpdTag
*
tag
)
static
void
clearMpdTag
(
struct
tag
*
tag
)
{
{
int
i
;
int
i
;
...
@@ -636,15 +636,15 @@ static void clearMpdTag(MpdTag * tag)
...
@@ -636,15 +636,15 @@ static void clearMpdTag(MpdTag * tag)
tag
->
time
=
-
1
;
tag
->
time
=
-
1
;
}
}
void
freeMpdTag
(
MpdTag
*
tag
)
void
freeMpdTag
(
struct
tag
*
tag
)
{
{
clearMpdTag
(
tag
);
clearMpdTag
(
tag
);
free
(
tag
);
free
(
tag
);
}
}
MpdTag
*
mpdTagDup
(
MpdTag
*
tag
)
struct
tag
*
mpdTagDup
(
struct
tag
*
tag
)
{
{
MpdT
ag
*
ret
;
struct
t
ag
*
ret
;
int
i
;
int
i
;
if
(
!
tag
)
if
(
!
tag
)
...
@@ -660,7 +660,7 @@ MpdTag *mpdTagDup(MpdTag * tag)
...
@@ -660,7 +660,7 @@ MpdTag *mpdTagDup(MpdTag * tag)
return
ret
;
return
ret
;
}
}
int
mpdTagsAreEqual
(
MpdTag
*
tag1
,
MpdTag
*
tag2
)
int
mpdTagsAreEqual
(
struct
tag
*
tag1
,
struct
tag
*
tag2
)
{
{
int
i
;
int
i
;
...
@@ -696,7 +696,7 @@ int mpdTagsAreEqual(MpdTag * tag1, MpdTag * tag2)
...
@@ -696,7 +696,7 @@ int mpdTagsAreEqual(MpdTag * tag1, MpdTag * tag2)
} \
} \
}
}
static
void
appendToTagItems
(
MpdTag
*
tag
,
enum
tag_type
type
,
static
void
appendToTagItems
(
struct
tag
*
tag
,
enum
tag_type
type
,
const
char
*
value
,
size_t
len
)
const
char
*
value
,
size_t
len
)
{
{
unsigned
int
i
=
tag
->
numOfItems
;
unsigned
int
i
=
tag
->
numOfItems
;
...
@@ -709,7 +709,8 @@ static void appendToTagItems(MpdTag * tag, enum tag_type type,
...
@@ -709,7 +709,8 @@ static void appendToTagItems(MpdTag * tag, enum tag_type type,
stripReturnChar
(
duplicated
);
stripReturnChar
(
duplicated
);
tag
->
numOfItems
++
;
tag
->
numOfItems
++
;
tag
->
items
=
xrealloc
(
tag
->
items
,
tag
->
numOfItems
*
sizeof
(
MpdTagItem
));
tag
->
items
=
xrealloc
(
tag
->
items
,
tag
->
numOfItems
*
sizeof
(
*
tag
->
items
));
tag
->
items
[
i
].
type
=
type
;
tag
->
items
[
i
].
type
=
type
;
tag
->
items
[
i
].
value
=
getTagItemString
(
type
,
duplicated
);
tag
->
items
[
i
].
value
=
getTagItemString
(
type
,
duplicated
);
...
@@ -717,7 +718,7 @@ static void appendToTagItems(MpdTag * tag, enum tag_type type,
...
@@ -717,7 +718,7 @@ static void appendToTagItems(MpdTag * tag, enum tag_type type,
free
(
duplicated
);
free
(
duplicated
);
}
}
void
addItemToMpdTagWithLen
(
MpdTag
*
tag
,
enum
tag_type
itemType
,
void
addItemToMpdTagWithLen
(
struct
tag
*
tag
,
enum
tag_type
itemType
,
const
char
*
value
,
size_t
len
)
const
char
*
value
,
size_t
len
)
{
{
if
(
ignoreTagItems
[
itemType
])
if
(
ignoreTagItems
[
itemType
])
...
...
src/tag.h
View file @
d0556dc9
...
@@ -45,34 +45,34 @@ enum tag_type {
...
@@ -45,34 +45,34 @@ enum tag_type {
extern
const
char
*
mpdTagItemKeys
[];
extern
const
char
*
mpdTagItemKeys
[];
typedef
struct
_MpdTagI
tem
{
struct
tag_i
tem
{
enum
tag_type
type
;
enum
tag_type
type
;
char
*
value
;
char
*
value
;
}
MpdTagItem
;
};
typedef
struct
_MpdT
ag
{
struct
t
ag
{
int
time
;
int
time
;
MpdTagI
tem
*
items
;
struct
tag_i
tem
*
items
;
mpd_uint8
numOfItems
;
mpd_uint8
numOfItems
;
}
MpdTag
;
};
#ifdef HAVE_ID3TAG
#ifdef HAVE_ID3TAG
MpdT
ag
*
parseId3Tag
(
struct
id3_tag
*
);
struct
t
ag
*
parseId3Tag
(
struct
id3_tag
*
);
#endif
#endif
MpdT
ag
*
apeDup
(
char
*
file
);
struct
t
ag
*
apeDup
(
char
*
file
);
MpdT
ag
*
id3Dup
(
char
*
file
);
struct
t
ag
*
id3Dup
(
char
*
file
);
MpdT
ag
*
newMpdTag
(
void
);
struct
t
ag
*
newMpdTag
(
void
);
void
initTagConfig
(
void
);
void
initTagConfig
(
void
);
void
clearItemsFromMpdTag
(
MpdTag
*
tag
,
enum
tag_type
itemType
);
void
clearItemsFromMpdTag
(
struct
tag
*
tag
,
enum
tag_type
itemType
);
void
freeMpdTag
(
MpdTag
*
tag
);
void
freeMpdTag
(
struct
tag
*
tag
);
void
addItemToMpdTagWithLen
(
MpdTag
*
tag
,
enum
tag_type
itemType
,
void
addItemToMpdTagWithLen
(
struct
tag
*
tag
,
enum
tag_type
itemType
,
const
char
*
value
,
size_t
len
);
const
char
*
value
,
size_t
len
);
#define addItemToMpdTag(tag, itemType, value) \
#define addItemToMpdTag(tag, itemType, value) \
...
@@ -80,10 +80,10 @@ void addItemToMpdTagWithLen(MpdTag * tag, enum tag_type itemType,
...
@@ -80,10 +80,10 @@ void addItemToMpdTagWithLen(MpdTag * tag, enum tag_type itemType,
void
printTagTypes
(
int
fd
);
void
printTagTypes
(
int
fd
);
void
printMpdTag
(
int
fd
,
MpdTag
*
tag
);
void
printMpdTag
(
int
fd
,
struct
tag
*
tag
);
MpdTag
*
mpdTagDup
(
MpdTag
*
tag
);
struct
tag
*
mpdTagDup
(
struct
tag
*
tag
);
int
mpdTagsAreEqual
(
MpdTag
*
tag1
,
MpdTag
*
tag2
);
int
mpdTagsAreEqual
(
struct
tag
*
tag1
,
struct
tag
*
tag2
);
#endif
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment