Commit Graph

37 Commits

Author SHA1 Message Date
ejurgensen c1c171e21f Include for av_rescale_q was missing
- and has been for a while, it seems
2013-09-04 22:33:47 +02:00
ejurgensen fa965dee75 Changed SAMPLE_FMT_S16 for ffmpeg 0.11 2013-05-24 20:33:26 +02:00
Julien BLACHE ed20d3f7de libav 0.7: use av_get_bytes_per_sample() instead of av_get_bits_per_sample_fmt() 2011-09-10 12:48:14 +02:00
Julien BLACHE dbe22c2c02 libav 0.7: use avformat_open_input() instead of av_open_input_file() 2011-09-10 12:48:14 +02:00
Julien BLACHE b1d31feb53 libav 0.7: Switch from av_get_bits_per_sample_format() to ..._fmt() 2011-06-02 22:16:52 +02:00
Julien BLACHE ecf064082f libav 0.7: Use skip_frame instead of hurry_up 2011-06-02 22:16:52 +02:00
Julien BLACHE b203f1ea1f libav 0.7: Replace CODEC_TYPE_* with AVMEDIA_TYPE_* 2011-06-02 22:09:42 +02:00
Julien BLACHE ec5ace7dc9 Reset hurry_up to 0 after we acquired a frame with known PTS 2011-06-02 22:06:44 +02:00
Julien BLACHE 67daf3259a Use avcodec_decode_audio3() when available (FFmpeg 0.6) 2011-02-23 18:26:42 +01:00
Julien BLACHE 75fb755db7 Assign ms to target_pts to ensure full 64bit computation of target_pts
Clang produced interesting results without this (or casting ms to int64_t),
as the seek target got mis-computed and fell short of the requested seek
target in ms (ex. wanted 18569 ms -> got 555 ms).
2010-09-13 22:06:53 +02:00
Julien BLACHE 115ded61d0 Move code around, no functional changes
Assign start_time right at the start, making the target_pts computation more
obvious wrt start_time and showing the symmetry of the target_pts and got_pts
computations.
2010-09-13 22:06:52 +02:00
Julien BLACHE d1af41f0e7 Fix got_pts computation wrt start_time
Substract start_time from got_pts after actually getting got_pts, and then
rescale the result.
2010-09-13 22:06:12 +02:00
Julien BLACHE 17daace67f Add seek support to transcode 2010-05-02 11:21:08 +02:00
Julien BLACHE 9fb7ec8e5c Make the WAV header optional 2010-05-02 11:21:08 +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 d71fa2b72e Replace av_read_packet() (obsolete) by av_read_frame()
Fixes MP3 playback, probably others too.
2010-03-25 20:28:23 +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 a5a46b8a53 Fix lseek() return value handling
lseek() returns an off_t and not an int, using an int to store and
test the return value means we'll error out when the position in the file
gets past INT_MAX.
2010-02-10 18:19:32 +01:00
Julien BLACHE 58faeaceca Integer types cleanup
Try to be a bit more strict about integer types, use off_t or int64_t for
file size and file offsets.

Replace safe_ato*() by safe_atoi32() and safe_atoi64(), fix integer types
at call sites to match.
2010-02-02 21:09:56 +01:00
Julien BLACHE dd1712abdc Use glibc endianness-related headers if available
BSD headers aren't working properly on kFreeBSD, so use the glibc ones.
2010-01-17 10:52:58 +01:00
Julien BLACHE 79cdb4f9aa Make forked-daapd build on GNU/kFreeBSD 2010-01-10 17:49:01 +01:00
Julien BLACHE 3724f943b9 Use sys/endian.h on FreeBSD 2010-01-09 13:42:59 +01:00
Julien BLACHE 974a74a833 Update copyright notices for 2010 2010-01-05 19:34:00 +01:00
Ace Jones 040e760789 Add support for Remote, the iPhone remote control for iTunes
Remote needs the same DAAP query quirk as iTunes and supports the
same codecs.
2009-12-30 18:49:52 +01:00
Julien BLACHE df2cbea9b2 Add supported codec list for Front Row and QuickTime
Patch from Ace Jones <ace.jones1@yahoo.com>.
2009-12-08 20:45:57 +01:00
Julien BLACHE 8f07db5c10 Add support for FLAC files with ID3v2 tags.
Patch from Wolfgang Holler <woelfs@googlemail.com>.
2009-11-18 20:14:03 +01:00
Julien BLACHE 11909725e2 Use ffmpeg's memory allocator for transcode buffer
ffmpeg's allocator ensures the allocated memory is properly aligned for
any kind of optimized operation used in ffmpeg.
2009-07-24 08:19:31 +02:00
Julien BLACHE 2323fd302c Fix memory leak (transcode buffer) 2009-07-24 08:18:53 +02:00
Julien BLACHE a200703393 Switch to the new database code 2009-06-10 19:04:18 +02:00
Julien BLACHE 11fd038d16 Use new logger facility 2009-05-09 17:14:06 +02:00
Julien BLACHE 10bb9dec57 Remove useless daapd.h 2009-05-05 16:22:11 +02:00
Julien BLACHE e4fe084619 Use embedded evhttp 2009-05-03 11:16:57 +02:00
Julien BLACHE 2c2498b6b4 Add transcoding infrastructure 2009-05-03 11:16:57 +02:00