Commit Graph

4972 Commits

Author SHA1 Message Date
Max Kellermann
bb4cef6a93 playlist/cue: fill song.start_ms, .end_ms
This patch adds practical usefulness to the CUE playlist plugin.
2009-12-27 16:08:53 +01:00
Max Kellermann
5787f73704 decoder, player: support song ranges
Seek the decoder to the start of the range before beginning with
playback.  Stop the decoder when the end of the range has been
reached.  Add the start position to the seek position.  Expose the
duration of the range, not the full song file.
2009-12-27 16:08:53 +01:00
Max Kellermann
201316cd67 playlist_queue: resolve relative URIs, database lookup
Prepend the playlist's base URI to relative song URIs.  Look up songs
in the database (if the URI refers to a local song file).  Merge
existing database metadata with metadata from the playlist plugin.
2009-12-27 16:08:53 +01:00
Max Kellermann
a038bca745 song: added support for selecting a time range
Added attributes start_ms, end_ms.  This allows us to address a
portion of a song file (important for CUE support).  There is no
support yet for storing these attributes in the state file.
2009-12-27 14:46:04 +01:00
Max Kellermann
cf38505d8f playlist_queue: load playlists from music directory
Try the playlist directory first, and if that file does not exist, try
the same relative path within the music directory.
2009-12-27 14:17:26 +01:00
Max Kellermann
af964e8929 uri: added function uri_safe_local() 2009-12-27 14:17:25 +01:00
Max Kellermann
554b2b0ed9 playlist/cue: return the original song URI
The caller should be responsible for building the absolute URI.
2009-12-27 14:17:21 +01:00
Max Kellermann
627975e897 playlist_queue: pass const string to playlist_open_path_into_queue() 2009-12-27 14:17:13 +01:00
Max Kellermann
6622d69fda song: added function song_get_duration() 2009-12-26 13:56:35 +01:00
Max Kellermann
216dff98d2 playlist_queue: try open by URI first
If that fails, try opening the file as a stream.
2009-12-26 03:01:52 +01:00
Max Kellermann
032354e65c playlist_list: use uri_get_suffix() 2009-12-26 03:01:50 +01:00
Max Kellermann
115d26608b uri: check presence of slash in suffix
If there's a slash in the uri_get_suffix() return value, then it's
malformed.  Return NULL in this case.
2009-12-26 03:01:48 +01:00
Max Kellermann
bad350bc18 decoder_api: added function decoder_timestamp()
Remove the data_time parameter from decoder_data().  This patch
eliminates the timestamp counting in most decoder plugins, because the
MPD core will do it automatically by default.
2009-12-26 03:01:43 +01:00
Max Kellermann
870436a592 output_init: use the normalize filter plugin
Use the plugin instead of the glue code in normalize.c.  This is used
wrapped inside a "autoconv" filter, to enable normalization for all
input file formats.
2009-12-25 17:51:08 +01:00
Max Kellermann
6a17233f78 filter: added the "autoconvert" filter plugin 2009-12-25 17:51:05 +01:00
Max Kellermann
b54bde6f2b filter_plugin: allow open() to force an input format
Make the audio_format argument non-const.  Allow the open() method to
modify it, to indicate that it wants a different input audio format
than the one specified.  Check that condition in chain_filter_open(),
and fail.
2009-12-25 17:29:41 +01:00
Max Kellermann
d2051c7f50 filter/volume: support 32 bit samples
The pcm_volume library supports 32 bit samples, there's no reason to
disallow it in the filter plugin.
2009-12-25 17:29:27 +01:00
Max Kellermann
bd29f7e3c8 filter/route: check configured channel count in method init()
Detect misconfiguration during MPD startup, not when playback begins.
2009-12-25 16:39:47 +01:00
Max Kellermann
c3bb81abec filter/route: route_filter_parse() returns bool
Indicate success and error.
2009-12-25 16:39:45 +01:00
Max Kellermann
d469c8137f filter_registry: removed the "chain" plugin from filter_plugins
This plugin cannot be configured.
2009-12-25 16:39:41 +01:00
Max Kellermann
c374a7d3f4 filter/chain: return NULL if a filter() method has failed
Don't close child filters in the filter() method.
2009-12-25 16:28:17 +01:00
Max Kellermann
3679d5bd7a playlist: added CUE playlist plugin
This plugin is the groundwork for MPD's future generic CUE sheet
support.  That's not complete yet, e.g. there is no way for a playlist
plugin to address an arbitrary position within a music file.
2009-12-16 22:19:01 +01:00
Max Kellermann
c128f2dd7e playlist_list: support URI suffix match
When no plugin matches the URI scheme, try the file name suffix.
2009-12-16 22:17:16 +01:00
Max Kellermann
843717d25c playlist_list: check if open method is present
Use open_uri() / open_stream() only after checking that they are
implemented.
2009-12-16 22:16:47 +01:00
Max Kellermann
50ea6a4b5c cue_tag: added song duration support
Get duration from track_get_length().
2009-12-16 22:15:27 +01:00
Max Kellermann
5649f22322 cue_tag: check cd_get_track()!=NULL 2009-12-16 20:55:19 +01:00
Max Kellermann
b89281411f cue_tag: added function cue_tag()
Merge code from cue_tag_file() and cue_tag_string().
2009-12-16 20:49:03 +01:00
Max Kellermann
67c41033c1 cue_tag: merged code into cue_tag_merge() 2009-12-16 17:27:52 +01:00
Max Kellermann
59534b92d2 cue_tag: pass "const" string to cue_tag_string() 2009-12-16 17:26:20 +01:00
Max Kellermann
41a48b14e3 cue_tag: changed runtime checks to assertions
It's illegal to pass NULL here.  This should not be ignored silently.
2009-12-16 17:26:20 +01:00
Max Kellermann
5821bd1a21 cue_tag: fixed indent and code style 2009-12-16 17:18:56 +01:00
Max Kellermann
c5cdac9609 cue_tag: tag_new() cannot fail
Removed the NULL check.
2009-12-16 17:18:23 +01:00
Max Kellermann
b7f55ad392 cue_tag: include cleanup 2009-12-16 17:13:26 +01:00
Max Kellermann
71fee09744 archive_plugin: use GError in the open() method 2009-12-16 17:10:19 +01:00
Max Kellermann
f9af1a445e input/archive: check for archive_file_open() errors
This fixes a NULL pointer dereference in case of archive plugin
failure.
2009-12-16 17:10:15 +01:00
Max Kellermann
0bc8c0c1da archive_plugin: wrap method calls
Make archive_file a "real" struct, extended by all plugins.  Add the
plugin pointer to it.  Wrap all method calls in functions.
2009-12-16 17:09:58 +01:00
Max Kellermann
74156d5bed archive_plugin: pass const string to method open() 2009-12-16 17:09:29 +01:00
Max Kellermann
b04adde7ab archive: added a C header for each plugin
Moved the archive plugin "extern" declarations into each plugin
header.
2009-12-16 15:57:16 +01:00
Max Kellermann
3f64ac04b8 archive/bz2: removed the bz2_context typedef
Use the raw struct name instead.
2009-12-16 15:56:42 +01:00
Max Kellermann
b009970af7 archive/bz2: renamed archive sources and plugin variables 2009-12-16 15:55:48 +01:00
Max Kellermann
bd97586cc4 archive/iso: renamed plugin to "iso9660"
Based on libiso9660.
2009-12-16 15:55:37 +01:00
Max Kellermann
c3e0fbd9e4 archive/bz2: use g_path_get_basename()
Use g_path_get_basename() instead of manually filtering the path
name.  Big advantage: g_path_get_basename() cannot fail.
2009-12-16 15:53:57 +01:00
Alam Arias
b05ba0286e updated mp4ff decoder about input_stream_seek 2009-12-16 06:47:15 +01:00
Max Kellermann
228b03edf8 input_stream: return errors with GError 2009-12-15 23:12:11 +01:00
Max Kellermann
d000d31355 encoder/flac: fix write callback prototype for libFLAC 1.1.2 2009-12-15 23:12:06 +01:00
Max Kellermann
971c9671f6 Makefile.am: link test/run_decoder with timer.c
For the fluidsynth plugin.
2009-12-15 23:11:57 +01:00
Max Kellermann
3d95226f2b decoder_internal: decoder_input_buffer() returns bool
This fixes a regression: a boolean value was returned from
decoder_input_buffer(), but the caller chose to do a "<= 0"
comparison.
2009-12-15 22:24:00 +01:00
Max Kellermann
b12072e6d9 input/archive: use g_path_is_absolute()
.. instead of manually checking pathname[0]=='/'.
g_path_is_absolute() is portable.
2009-12-15 21:26:16 +01:00
Max Kellermann
03427d4eff archive/bz2: simplified error handling, short read
Don't attempt to fill the whole buffer in the read() method, return
whatever libbz2 provides with the first successful BZ2_bzDecompress().
2009-12-15 21:09:13 +01:00
Max Kellermann
a627a703ca archive/bz2: no CamelCase 2009-12-15 20:53:29 +01:00