Commit Graph

236 Commits

Author SHA1 Message Date
Max Kellermann
8edd407918 faad: added length check before comparing "ADIF"
It's not valid to use the buffer's data without ensuring that the
buffer contains enough data.
2009-02-17 19:27:36 +01:00
Max Kellermann
d75ce5c4a0 faad: renamed internal functions
"aac" -> "faad"
2009-02-17 19:27:01 +01:00
Max Kellermann
943b17c99a wavpack: added GLib log domain 2009-02-17 19:26:36 +01:00
Max Kellermann
d8db46edfa decoders: added and fixed GLib log domains
Fixed the log domains of the renamed decoders.  Added G_LOG_DOMAIN
macros in decoders which don't have one already.
2009-02-17 08:51:34 +01:00
Max Kellermann
c4d69f0ae1 renamed decoder plugin "mpc" to "mpcdec"
This plugin is based on "libmpcdec".
2009-02-17 08:48:20 +01:00
Max Kellermann
70523657bf renamed decoder plugin "mp4" to "mp4ff"
This plugin is based on "libmp4ff".
2009-02-17 08:45:26 +01:00
Max Kellermann
68314c33e9 faad: no CamelCase
Renamed functions and variables.
2009-02-16 19:31:11 +01:00
Max Kellermann
8d2e6bf54c faad: removed AacBuffer.fileOffset
The element fileOffset is only written, but never read.  It can be
removed safely.
2009-02-16 19:31:08 +01:00
Max Kellermann
c6205bd461 renamed decoder plugin "oggvorbis" to "vorbis"
This plugin uses libvorbis.
2009-02-16 19:31:06 +01:00
Max Kellermann
cafaf33aa8 renamed decoder plugin "aac" to "faad"
A decoder plugin should be named after the library which is used.
2009-02-16 19:30:54 +01:00
Max Kellermann
c5edb53797 renamed decoder plugin "mp3" to "mad"
A decoder plugin should be named after the library which is used.
2009-02-16 19:30:45 +01:00
Max Kellermann
ed591f19ef wildmidi: check if configurationn file exists
Don't call WildMidi_Init() if the configuration file does not exist.
Don't let libwildmidi clutter stderr with its warning message.
2009-02-15 18:41:05 +01:00
Max Kellermann
5c68f91dae wildmidi: obtain timidity.cfg location from mpd.conf 2009-02-15 18:41:03 +01:00
Max Kellermann
dec5d48f80 decoder_plugin: pass struct config_param to init() method
Preparing for per-plugin configuration sections in mpd.conf.
2009-02-15 18:34:14 +01:00
Max Kellermann
a06e281421 aac: fix stream metadata
Pass the input_stream object to decoder_data().  Without it, the MPD
core does not see stream tags.
2009-02-12 18:39:19 +01:00
Max Kellermann
a2ce6e5b82 wildmidi: added seeking support
Use WildMidi_SampledSeek() for seeking in a MIDI file.
2009-02-12 18:19:13 +01:00
Max Kellermann
321eb1077a wildmidi: provide and current total song time
The _WM_Info struct provides all we need, it is obtained by
WildMidi_GetInfo().
2009-02-12 16:47:48 +01:00
Max Kellermann
1492339463 wildmidi: new decoder plugin for MIDI files 2009-02-12 16:43:18 +01:00
Max Kellermann
e56a90f3b3 fluidsynth: new decoder plugin for MIDI files
There are a few problems left in this plugin:

- fluidsynth decodes in real time, while MPD prefers to buffer as
  quickly as possible; as a workaround, this plugin uses a timer
  object to synchronize with real-time playback

- I don't know yet how fluidsynth tells me when the song has ended

- the "soundfont" configuration setting is not yet documented, and it
  will likely change soon (in favor of a per-decoder configuration
  block)
2009-02-12 08:43:26 +01:00
Max Kellermann
1136f6fb7a sidplay: new decoder plugin for playing C64 SID files 2009-02-11 20:31:17 +01:00
Max Kellermann
550b9c3f23 ffmpeg: added TTA support
The ffmpeg library supports the "True Audio Codec".  The entry in
ffmpeg_suffixes was missing.
2009-02-11 18:27:11 +01:00
Max Kellermann
824d299eb1 ffmpeg: fixed seek integer overflow
The "current" variable is used for calculating the seek destination,
and was declared as "int".  With very long song files, the 32 bit
integer can overflow.  ffmpeg expects an int64_t, which is very
unlikely to overflow.  Switch to int64_t.
2009-02-03 22:51:44 +01:00
Max Kellermann
f3b73b824f ffmpeg: check if the time stamp is valid
When ffmpeg cannot estimate the elapsed time, it sets
AVPacket.pts=AV_NOPTS_VALUE.  Our ffmpeg decoder plugin did not check
for that special value.
2009-02-03 22:51:41 +01:00
Max Kellermann
81b6c0d77b ffmpeg: don't warn of empty packet output
If avcodec_decode_audio2() returns no output for an AVPacket,
libavcodec may buffer some data, and return a larger chunk of output
later.  This patch disables a lot of bogus warnings.
2009-02-03 22:51:38 +01:00
Max Kellermann
a7632b09e0 ffmpeg: print codec name
Output the name of the codec as a debug message.  During my tests,
ffmpeg never filled this struct member, but it may do so in the past,
and this debug message might become helpful.
2009-02-03 22:51:35 +01:00
Matthias Drochner
5b85288664 mikmod: call MikMod_Exit() only in the finish() method
Hi -
independently of libmikmod's other problems - there seems
to be a problem in mpd's wrapper: MikMod_Exit() is called
after the first file is decoded, which frees some ressources
within the mikmod library. An attempt to play a second file
leads to a crash. The appended patch fixes this for me.
(I don't know what the "dup" entry is good for - someone
who knows should review that too.)
best regards
Matthias

[mk: removed 3 more MikMod_Exit() invocations]
2009-01-30 17:51:16 +01:00
Max Kellermann
02bfb0c4e4 wavpack: pass NULL if the .wvc file fails to open
The wavpack library seems to use the .wvc stream even if the OPEN_WVC
flag is not set.  In this case, pass NULL to be sure libwavpack won't
use it.
2009-01-30 16:05:02 +01:00
David Horn
efb04532df ffmeg: added support for the tags comment, genre, year
ffmpeg_tag_internal() does not look for a few tags that mpd
supports. Most noteably:

 comment -> TAG_ITEM_COMMENT -> Description
 genre -> TAG_ITEM_GENRE -> WM/Genre (not WM/GenreID)
 year -> TAG_ITEM_DATE -> WM/Year

I *think* that this is the last of the tags that AVFormatContext() in
ffmpeg supports that mpd also uses.
2009-01-30 09:42:49 +01:00
Max Kellermann
a45922cd66 use g_free() instead of free()
On some platforms, g_free() must be used for memory allocated by
GLib.  This patch intends to correct a lot of occurrences, but is
probably not complete.
2009-01-25 18:47:21 +01:00
Max Kellermann
2bfe6f6412 renamed the "mod" decoder plugin to "mikmod"
We have two mod plugins now: modplug and mod.  Rename the latter to a
more useful name.
2009-01-24 20:18:44 +01:00
Max Kellermann
0dc1b4a44e modplug: removed EOF check from the while loop
EOF is checked by input_stream_read() (decoder_read() here).  Don't do
it twice.  The check was wrong anyway, it was reversed.
2009-01-24 20:02:06 +01:00
Max Kellermann
793934cf9c modplug: check for input_stream errors
When input_stream_read() returns 0, and input_stream_eof() returns
false, an I/O error has occured.  Skip this song.
2009-01-24 19:16:33 +01:00
Max Kellermann
14b37656a6 modplug: use size_t instead of int for buffer sizes 2009-01-24 19:16:31 +01:00
Max Kellermann
4a4c6fb6dc modplug: check size limit before appending new buffer
Don't enlarge the GByteArray when the size limit may overflow in this
operation; check the size limit first.
2009-01-24 19:16:20 +01:00
Max Kellermann
b53e80d785 modplug: use GByteArray.len, remove total_len
The local variable "total_len" is superfluous because GByteArray
always knows its size.
2009-01-24 19:16:10 +01:00
Max Kellermann
0c71640528 modplug: unknown size is -1; check for empty file
The input_stream API sets size to -1 when the size of the resource is
not known.  The modplug decoder checked for size==0, which would be an
empty file.
2009-01-24 19:16:07 +01:00
Max Kellermann
961d172200 modplug: header cleanup
Don't include utils.h and log.h, they are relics from the past.
2009-01-24 19:16:05 +01:00
Max Kellermann
9229869f04 modplug: define G_LOG_DOMAIN
Make sure that log messages are decorated correctly.
2009-01-24 19:15:53 +01:00
Max Kellermann
b381638009 modplug: declare constants as enum
Don't write CPP if you can write C.
2009-01-24 19:15:50 +01:00
Max Kellermann
24d4c2df92 modplug: use only decoder_read(), not input_stream_read()
You are allowed to call decoder_read() with decoder==NULL.  It is a
convenience function provided by the decoder API.  Don't manually fall
back to input_stream_read().
2009-01-24 19:15:48 +01:00
Andrzej Rybczak
82df4cb2b0 modplug: change settings before loading a file
alternative settings must be set before the file
is loaded, otherwise they won't be respected.
2009-01-24 13:10:02 +01:00
Max Kellermann
fbed96dcea flac: include config.h
The plugin queries build-time configuration variables, and should
include config.h.
2009-01-19 09:54:47 +01:00
Max Kellermann
a1a97cc048 conf: use config_get_bool() instead of getBoolConfigParam() 2009-01-17 20:23:33 +01:00
Max Kellermann
5395f5f6b3 moved fallback APE/ID3 tag loader to song.c
Some plugins used the APE or ID3 tag loader as a fallback when their
own methods of loading tags did not work.  Move this code out of all
decoder plugins, into song_file_update().
2009-01-17 13:23:42 +01:00
Max Kellermann
d83eff80a5 oggvorbis: disable seeking on remote songs
When libvorbis knows that a song is seekable, it seeks around like
crazy in the file before starting to decode it.  This is very
expensive on remote HTTP resources, and delays MPD for 10 or 20
seconds.

This patch disables seeking on remote songs, because the advantages of
quickly playing a song seem to weigh more than the theoretical ability
of seeking for most MPD users.  If users feel this feature is needed,
we will make a configuration option for that.
2009-01-17 11:46:31 +01:00
Qball Cow
b533307d6f Enable wav file streaming for ffmpeg input plugin 2009-01-16 17:11:16 +01:00
Rasmus Steinke
3e87e4f3ab flac: map "Album Artist" to "AlbumArtist"
This patch allows mpd to recognise the albumartist tag in the way
foobar2000 and others write it to files.
2009-01-15 22:45:29 +01:00
Max Kellermann
9cc373d62d flac: splitted flac_copy_vorbis_comment()
Splitted flac_copy_vorbis_comment() into flac_copy_comment() and
flac_copy_comment().
2009-01-15 22:45:28 +01:00
Max Kellermann
0dec3f787f flac: moved code to flac_comment_value()
Simplify flac_copy_vorbis_comment() by moving the comment
identification code out.
2009-01-15 22:44:21 +01:00
Max Kellermann
f30adc3526 flac: always allocate tag object
Free the tag object when it turns out to be empty.  This simplifies
several functions and APIs.
2009-01-15 22:43:39 +01:00