diff options
| author | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2010-01-17 03:10:22 +0000 |
|---|---|---|
| committer | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2010-01-17 03:10:22 +0000 |
| commit | e890141a04b1e79feddf17b4db460050a25f613e (patch) | |
| tree | 9711272317c20b5f9f387c9063f73beef76260c0 /src/demuxers | |
| parent | f6456aeccb0e7a420aa25997d8fe6ee87da489a5 (diff) | |
| download | xine-lib-e890141a04b1e79feddf17b4db460050a25f613e.tar.gz xine-lib-e890141a04b1e79feddf17b4db460050a25f613e.tar.bz2 | |
"Fix" playback of 24-bit FLAC.
We pretend that it's 16-bit to avoid "audio device unavailable" (ALSA).
Also, the clock is a bit fast.
Diffstat (limited to 'src/demuxers')
| -rw-r--r-- | src/demuxers/demux_flac.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/demuxers/demux_flac.c b/src/demuxers/demux_flac.c index 976656016..11bbda061 100644 --- a/src/demuxers/demux_flac.c +++ b/src/demuxers/demux_flac.c @@ -364,12 +364,15 @@ static void demux_flac_send_headers(demux_plugin_t *this_gen) { return; } + /* lie about 24bps */ + int bits = this->bits_per_sample > 16 ? 16 : this->bits_per_sample; + buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = BUF_AUDIO_FLAC; buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; buf->decoder_info[0] = 0; buf->decoder_info[1] = this->sample_rate; - buf->decoder_info[2] = this->bits_per_sample; + buf->decoder_info[2] = bits; buf->decoder_info[3] = this->channels; /* copy the faux WAV header */ buf->size = sizeof(xine_waveformatex) + FLAC_STREAMINFO_SIZE; @@ -386,7 +389,7 @@ static void demux_flac_send_headers(demux_plugin_t *this_gen) { _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_SAMPLERATE, this->sample_rate); _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITS, - this->bits_per_sample); + bits); this->status = DEMUX_OK; } |
