Commit Graph

2067 Commits

Author SHA1 Message Date
Julien BLACHE
262dec9daa Document the SQLite3 update notify API requirements 2010-05-02 08:23:21 +02:00
Julien BLACHE
00d6381f15 Introduce and use db_blocking_{prepare_v2,step}
Make use of the SQLite3 unlock notify API to wait for the database to
become available. From the SQLite3 sample code for the unlock notify API.

This requires SQLite3 to be built with SQLITE_ENABLE_UNLOCK_NOTIFY.
2010-05-02 08:23:21 +02:00
Julien BLACHE
f9454aa4a3 Introduce db_exec(), replacing sqlite3_exec() 2010-05-02 08:23:21 +02:00
Julien BLACHE
10b246a22b Check for the unlock notify API in SQLite3 2010-05-02 08:23:18 +02:00
Julien BLACHE
f2cf59c26c Raise SQLite3 version requirement to 3.5.0
Needed for per-process (!= per-thread) shared-cache support.
2010-05-02 08:22:41 +02:00
Julien BLACHE
dc18860dc5 Enable SQLite3 shared-cache mode
This requires SQLite 3.5.0+ for per-process (as opposed to per-thread)
shared-cache support.

It also enables the use of the unlock notify API.
2010-05-02 08:22:41 +02:00
Julien BLACHE
d2932896a3 Switch SQLite3 to SQLITE_CONFIG_MULTITHREAD mode 2010-05-02 08:22:41 +02:00
Julien BLACHE
857e52420e Check whether SQLite3 was built with threadsafe operations support
Can't check at configure time when cross-compiling; this is checked
again at runtime during startup, when initializing SQLite3.
2010-05-02 08:22:32 +02:00
Julien BLACHE
0411720a58 Perform explicit sqlite3 init/deinit 2010-04-26 18:24:09 +02:00
Dustin King
4551d530f9 Lower logging level for files with no metadata 2010-04-10 11:23:11 +02:00
Dustin King
ce8fe19627 Add handlers for ID3v2 track and disc fields 2010-04-10 11:21:04 +02:00
Dustin King
61f5b6d833 Run two passes for gathering metadata
The extra md_map needs to be used before the generic md_map because
the extra md_map needs to be used before av_metadata_conv while the
generic md_map needs to be used after av_metadata_conv. This allows
handling of things like ID3v2 track fields which get mapped to the
generic track field by av_metadata_conv but actually contain both
track number and the total number of tracks on the disc.

Note: modified from Dustin's original patch.
2010-04-10 11:15:16 +02:00
Dustin King
b8b205e7f2 Add function pointer for metadata handler to struct metadata_map 2010-04-10 10:59:29 +02:00
Dustin King
b219b912f2 Split out VORBIS field names into a dedicated extra md_map 2010-04-10 10:55:52 +02:00
Julien BLACHE
f36261be65 Add album_artist to the generic md_map
The generic metadata field name is album_artist and not albumartist; that, or we
previously missed that field.
2010-04-10 10:55:52 +02:00
Dustin King
a5bdb9d59a Identify TDRC as coming from ID3v2.4 2010-04-10 10:55:46 +02:00
Julien BLACHE
1df0258055 Demote "could not find requested meta field" message to E_WARN 2010-04-10 09:46:48 +02:00
Julien BLACHE
5475c18308 Remove FLAC-specific raw mode
Older versions of ffmpeg did not support raw FLAC streams properly and needed
to be fed the raw stream manually; looks like it's been fixed in ffmpeg 0.5.
2010-03-28 16:19:30 +02:00
Julien BLACHE
887d1bf5ca Small clarification in transcode_cleanup() 2010-03-28 16:14:36 +02:00
Julien BLACHE
21e564e493 Add the DISCTOTAL tag for formats using VORBIS comments 2010-03-27 12:08:49 +01:00
Julien BLACHE
e87f46e95c Add the TRACKTOTAL tag for format using VORBIS comments 2010-03-25 21:40:17 +01:00
Julien BLACHE
b7ec65963d Constify data tables where possible 2010-03-25 21:40:17 +01:00
Julien BLACHE
c545e52374 Simplify streams handling
Keep pointers to the streams instead of the stream number.
2010-03-25 21:40:17 +01:00
Julien BLACHE
6677b3435d Call av_metadata_conv() to convert metadata to ffmpeg's generic format
This is actually needed for everything to work properly, but it only really
started breaking with newer versions of ffmpeg where more demuxers have been
completely ported over to the metadata API.
2010-03-25 21:40:17 +01:00
Julien BLACHE
04e8f5cfd6 Split TV show tags out of the generic md_map 2010-03-25 21:39:41 +01:00
Julien BLACHE
27a095b606 Split ID3 tags out of the generic md_map 2010-03-25 21:38:19 +01:00
Julien BLACHE
52e38dd76a Allow a secondary metadata map for metadata extraction 2010-03-25 21:38:19 +01:00
Julien BLACHE
4da80edc3f Pick up metadata from the selected stream(s) in addition to the file itself
OGG has per-stream metadata; recent versions of ffmpeg report metadata
per-stream in this case.
2010-03-25 21:38:19 +01:00
Julien BLACHE
c2f64e4280 Split metadata extraction out of scan_metadata_ffmpeg() 2010-03-25 21:38:19 +01:00
Julien BLACHE
d71fa2b72e Replace av_read_packet() (obsolete) by av_read_frame()
Fixes MP3 playback, probably others too.
2010-03-25 20:28:23 +01:00
Dustin King
e6d75534d7 Make database location a configuration item 2010-03-21 11:33:05 +01:00
Julien BLACHE
6c6a3a7935 Make a note to remove ID3v2 tag names ASAP 2010-03-21 11:27:55 +01:00
Dustin King
6424a1fe95 Add ID3v2.2 tag names 2010-03-21 11:21:43 +01:00
Dustin King
39dfa4dae1 Mark ID3v2.3 metadata tag names as such 2010-03-21 11:18:10 +01:00
Julien BLACHE
602c30c37a Fix typo 2010-03-19 19:58:45 +01:00
Julien BLACHE
4996965b34 Handle database upgrade v8 -> v9 2010-03-19 19:14:34 +01:00
Julien BLACHE
19b6780a3c Remove provisions for multi-library support
It is now clear that multi-library support will not happen, so remove whatever
provisions were in the code for that.

It comes with a small change to the configuration file, too.

With this, DB schema version went to 9.
2010-03-19 19:09:18 +01:00
Julien BLACHE
d6285eef40 Add audio resampling to the audio decoding code
Transcoded (decoded) files will now always come out in signed, little endian,
16bit, 44100 Hz, stereo format regardless of the format of the input file.

This in effect fixes transcoding (and playback on some devices) for files that
do not match this format.

There's probably a discussion to be had regarding handling of 48 kHz and 96 kHz
content, though, as downsampling to 44.1 kHz to have the client or final output
device upsample again is clearly not an optimal solution.
2010-03-15 18:38:33 +01:00
Julien BLACHE
8375ac75ca Rework error handling in transcode_setup()
Add the setup_fail_codec label and jump to it if an error occurs once the
codec has been opened. In the raw input codepath, don't use this label until
the file is properly opened, as it also closes the fd and frees the raw
buffer.

This also fixes a file descriptor leak in the case where an error happened
after the file was opened in the raw input codepath.
2010-03-15 18:35:29 +01:00
Julien BLACHE
db0690afa1 Use int16_t for decoded audio data buffers 2010-03-15 18:34:14 +01:00
Julien BLACHE
9e8403061c Add TPE2 -> albumartist ID3v2 mapping
Reported by Ace Jones.
2010-03-10 17:11:08 +01:00
Julien BLACHE
5da807f829 Add ID3v2 tags to the metadata table
ffmpeg doesn't convert ID3v2 tag names to generic metadata names, so
add the ID3v2 tag names to the table to pick them up.

This fixes scanning of MP3 files in various cases.

More in this post and its attachment:
<http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2009-September/076213.html>

Thanks to Raivo Hool for bringing up the issue and fix.
2010-03-07 19:18:06 +01:00
Julien BLACHE
4e74119d2a Document artwork support 2010-03-07 16:10:04 +01:00
Julien BLACHE
ece7c0d071 Handle DAAP extra_data requests for groups/items artwork 2010-03-07 15:45:52 +01:00
Julien BLACHE
0eca9b4313 Add artwork handling routines
External artwork only, until ffmpeg supports embedded artwork.
2010-03-07 15:45:47 +01:00
Julien BLACHE
2a16bfdc6c Add libswscale to the required ffmpeg libraries 2010-03-07 15:23:41 +01:00
Julien BLACHE
666ce98055 Add a logdomain for artwork handling 2010-03-07 15:23:40 +01:00
Julien BLACHE
ca1c72651f Bump log prefix size to 8 2010-03-07 15:23:40 +01:00
Julien BLACHE
b0e10fb97d Add groups queries 2010-03-07 15:23:40 +01:00
Julien BLACHE
641e5462cc Rename pl_id member of struct query_params 2010-03-07 15:23:40 +01:00