David Woodhouse
37754559b8
Add audio_format_init() function
...
It makes no difference right now, but we're about to add an endianness
flag and will want to make sure it's correctly initialised every time.
2009-07-19 16:54:11 +01:00
Max Kellermann
eacd604518
ffmpeg: support multiple tags
...
Call av_metadata_get() in a loop.
2009-06-25 08:43:59 +02:00
Max Kellermann
74334a516c
ffmpeg: moved code to ffmpeg_copy_metadata()
2009-06-08 08:45:54 +02:00
Max Kellermann
f5d4079d11
ffmpeg: removed "new metadata api" warning
...
This warning is useless. I assume the author added it for debugging
purposes.
2009-06-08 08:41:07 +02:00
Avuton Olrich
fd90db35b7
decoder: Rename all main decoder plugins functions to *decoder_plugin.
2009-04-02 15:55:10 -07:00
Avuton Olrich
0aee49bdf8
all: Update copyright header.
...
This updates the copyright header to all be the same, which is
pretty much an update of where to mail request for a copy of the GPL
and the years of the MPD project. This also puts all committers under
'The Music Player Project' umbrella. These entries should go
individually in the AUTHORS file, for consistancy.
2009-03-13 11:51:55 -07:00
Viliam Mateicka
3b76ca7186
ffmpeg: fix version comparision for av_get_bits_per_sample_format() implemetation
...
function was implemented in the version we are comparing to so there must be higher or equal
2009-03-03 21:30:55 +01:00
Viliam Mateicka
c89482de65
ffmpeg: support for new metadata api
2009-03-03 21:30:46 +01:00
Viliam Mateicka
8694574f63
ffmpeg: use ffmpeg's sampleformat for output format
2009-03-02 20:12:36 +01:00
Avuton Olrich
39a33344f2
ffmpeg: add all known ffmpeg extensions and mime-types.
...
After much research[1][2][3] this should be the majority of currently
supported file extensions and mime-types for the currently supported
ffmpeg formats. This list maybe incomplete, but it's more complete
than anything else out there that I've been able to find. This list
needs to be updated every now and again as the ffmpeg sources support
more formats.
1. Sources
2. wiki.multimedia.cx
3. filext.com
2009-02-23 10:48:43 -08: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
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
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
Qball Cow
b533307d6f
Enable wav file streaming for ffmpeg input plugin
2009-01-16 17:11:16 +01:00
Max Kellermann
5e93d3682f
added missing explicit config.h includes
2009-01-08 21:37:02 +01:00
Max Kellermann
17bdcc8bae
decoder plugins: don't include gcc.h
...
Use GLib's G_GNUC_UNUSED instead of gcc.h's mpd_unused.
2009-01-01 18:09:24 +01:00
Max Kellermann
7f98ba24c7
ffmpeg: case AV_NOPTS_VALUE to int64_t
...
The old code casted it to a 32 bit integer, which cut off bits.
AVFormatContext.duration is a int64_t, so use this type.
2008-12-24 11:56:53 +01:00
Max Kellermann
82ef85a309
ffmpeg: don't assign "0" to pointer
...
Use NULL instead. Found by sparse.
2008-12-24 11:49:37 +01:00
Viliam Mateicka
88ab54d3d4
ffmpeg: fixing ffmpeg_send_packet to allow multipackets
2008-12-15 19:37:10 +01:00
Viliam Mateicka
8a412aaa27
ffmpeg: adding APE support
2008-12-15 19:34:58 +01:00
Max Kellermann
976d5045c6
decoder: check audio_format_valid() in all decoders
...
Refuse to play audio formats which are not supported by MPD.
2008-11-21 20:27:30 +01:00
Max Kellermann
f15fc4e99a
ffmpeg: use GLib instead of log.h
2008-11-21 20:13:41 +01:00
Viliam Mateicka
33b5015469
ffmpeg: read tags from AVFormatContext
...
The ffmpeg library provides some of the song metadata in the
AVFormatContext struct. Pass it from there to MPD.
2008-11-18 20:03:00 +01:00
Max Kellermann
8882f06200
ffmpeg: fixed AVSEEK_SIZE
...
With whence==AVSEEK_SIZE, the seek function should return the file
size, not the current offset. Check the return value of
input_stream_seek().
2008-11-16 20:25:31 +01:00
Max Kellermann
9eed41911f
decoder: return void from decode() methods
...
The stream_decode() and file_decode() methods returned a boolean,
indicating whether they were able to decode the song. This is
redundant, since we already know that: if decoder_initialized() has
been called (and dc.state==DECODE), the plugin succeeded. Change both
methods to return void.
2008-11-11 17:13:44 +01:00
Max Kellermann
ff1acefb21
decoder: removed plugin method try_decode()
...
Instead of having a seprate try_decode() method, let the
stream_decode() and file_decode() methods decide whether they are able
to decode the song.
2008-11-10 15:07:01 +01:00
Max Kellermann
85a7d1a148
decoder: removed stream_types
...
Instead of checking the stream_types bit set, we can simply check
whether the methods stream_decode() and file_decode() are implemented.
2008-11-04 17:10:19 +01:00
Max Kellermann
ab07cdd453
ffmpeg: removed loop from mpd_ffmpeg_read()
...
The function decoder_read() already cares about the decoder command,
and loops until data is available. Reduced mpd_ffmpeg_read() to no
more than the decoder_read() call.
2008-11-04 16:55:12 +01:00
Max Kellermann
292334a27a
ffmpeg: removed ffmpeg_context.codec
...
That variable is never used except during initialization in
ffmpeg_helper().
2008-11-04 16:55:12 +01:00
Max Kellermann
7e84c73b17
ffmpeg: moved code to ffmpeg_find_audio_stream()
2008-11-04 16:55:12 +01:00
Max Kellermann
5e486964e8
ffmpeg: no CamelCase
...
Renamed variables.
2008-11-04 16:55:11 +01:00
Max Kellermann
e5137706d1
ffmpeg: fix boolean inversion in ffmpeg_tag()
...
ffmpeg_tag() deleted the tag when ffmpeg_helper() returned success.
The return value was interpreted incorrectly, it should return the tag
on success.
2008-11-02 17:32:40 +01:00
Max Kellermann
accc82cd6c
ffmpeg: don't rewind stream in url_close()
...
Rewinding the stream here is not useful, but may consume valuable
resources (and time).
2008-11-02 17:10:12 +01:00
Max Kellermann
0f80428fda
ffmpeg: use decoder_read() wrapper instead of direct input_stream_read()
...
decoder_read() checks the decoder command. Without this patch, the
ffmpeg plugin could become unresponsive.
2008-11-02 17:06:53 +01:00
Max Kellermann
4d069b4991
ogg, ffmpeg: try to decode, even when the stream is not seekable
...
Ogg and ffmpeg detection was disabled when the stream was not
seekable, because the detection was too expensive. Since the curl
input stream can now rewind the stream cheaply, we can re-enable
detection on streams.
2008-11-02 17:06:32 +01:00
Max Kellermann
c9e15bc418
decoder_api: pass "seekable" flag to decoder_initialized()
...
Don't pass the "seekable" flag with every decoder_data() invocation.
Since that flag won't change within the file, it is enough to pass it
to decoder_initialized() once per file.
2008-11-02 17:01:51 +01:00
Max Kellermann
4c1b96c307
decoder: make the suffixes and mime_types arrays really const
...
The strings were constant, but the pointers weren't. C syntax is
somewhat tricky..
2008-11-01 14:55:23 +01:00
Max Kellermann
0b614fbaae
decoder: make all decoder_plugin structs const
...
All decoder_plugin structs are initialized at compile time, and must
never change.
2008-11-01 14:54:09 +01:00
Max Kellermann
78448fe1a5
decoder_api: pass constant path pointers
2008-10-31 15:56:43 +01:00
Max Kellermann
5024f0b6cc
ffmpeg: pass input_stream pointer to decoder_data()
...
decoder_data() uses wait times to let the input stream continue its
transfer.
2008-10-30 19:09:20 +01:00
Max Kellermann
b15c4cdeb5
ffmpeg: use return value of decoder_data()
...
decoder_data() always returns the current command. If we use this, we
can save a lot of decoder_get_command() calls.
2008-10-30 19:03:41 +01:00
Max Kellermann
f3b4a28518
ffmpeg: output buffer size cannot be negative
...
Converted the runtime check to an assertion.
2008-10-30 19:03:38 +01:00
Max Kellermann
130fc58b36
ffmpeg: break immediately after av_read_frame()
...
Remove one indent level.
2008-10-30 19:03:31 +01:00
Max Kellermann
5f1df0a927
ffmpeg: moved code to ffmpeg_send_frame()
...
Move code from ffmpeg_decode_internal() to make it smaller and more
readable.
2008-10-30 19:03:20 +01:00
Max Kellermann
048d62a628
ffmpeg: report seek errors to MPD
...
The decoder API provides the function decoder_seek_error() to report
seek errors. Use this function instead of logging the error.
2008-10-30 19:02:38 +01:00
Max Kellermann
cd7a720426
ffmpeg: simplified mpdurl_read()
...
The function mpdurl_read() is too complicated, and uses the wrong data
types.
2008-10-30 19:02:01 +01:00