diff options
author | Max Kellermann <max@duempel.org> | 2012-03-27 00:03:44 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2012-03-27 01:17:11 +0200 |
commit | ebfdd37451cea0151de74005d83db5ac31fcaf77 (patch) | |
tree | e87c20dc2951cdb617d78201d14e0b65476d2b2c /src/output | |
parent | f6d6110aaaf6ba3e252323c2bf6360ea9782dff2 (diff) | |
download | mpd-ebfdd37451cea0151de74005d83db5ac31fcaf77.tar.gz mpd-ebfdd37451cea0151de74005d83db5ac31fcaf77.tar.xz mpd-ebfdd37451cea0151de74005d83db5ac31fcaf77.zip |
pcm_export: support DSD to DSD-over-USB conversion
Prepare for removing SAMPLE_FORMAT_DSD_OVER_USB.
Diffstat (limited to 'src/output')
-rw-r--r-- | src/output/alsa_output_plugin.c | 8 | ||||
-rw-r--r-- | src/output/oss_output_plugin.c | 10 |
2 files changed, 12 insertions, 6 deletions
diff --git a/src/output/alsa_output_plugin.c b/src/output/alsa_output_plugin.c index 21c3b1d22..d131003e3 100644 --- a/src/output/alsa_output_plugin.c +++ b/src/output/alsa_output_plugin.c @@ -633,8 +633,9 @@ alsa_setup_or_dsd(struct alsa_data *ad, struct audio_format *audio_format, if (!success) return false; - pcm_export_open(&ad->export, audio_format->format, - packed, reverse_endian); + pcm_export_open(&ad->export, + audio_format->format, audio_format->channels, + false, packed, reverse_endian); return true; } @@ -777,7 +778,8 @@ alsa_play(struct audio_output *ao, const void *chunk, size_t size, if (ret > 0) { ad->period_position = (ad->period_position + ret) % ad->period_frames; - return ret * ad->in_frame_size; + return pcm_export_source_size(&ad->export, + ret * ad->in_frame_size); } if (ret < 0 && ret != -EAGAIN && ret != -EINTR && diff --git a/src/output/oss_output_plugin.c b/src/output/oss_output_plugin.c index 0724ed4c2..85bdc37dc 100644 --- a/src/output/oss_output_plugin.c +++ b/src/output/oss_output_plugin.c @@ -540,7 +540,7 @@ oss_probe_sample_format(int fd, enum sample_format sample_format, *oss_format_r = oss_format; #ifdef AFMT_S24_PACKED - pcm_export_open(export, sample_format, + pcm_export_open(export, sample_format, 0, false, oss_format == AFMT_S24_PACKED, oss_format == AFMT_S24_PACKED && G_BYTE_ORDER != G_LITTLE_ENDIAN); @@ -755,8 +755,12 @@ oss_output_play(struct audio_output *ao, const void *chunk, size_t size, while (true) { ret = write(od->fd, chunk, size); - if (ret > 0) - return (size_t)ret; + if (ret > 0) { +#ifdef AFMT_S24_PACKED + ret = pcm_export_source_size(&od->export, ret); +#endif + return ret; + } if (ret < 0 && errno != EINTR) { g_set_error(error, oss_output_quark(), errno, |