From 4f15e599001466e189940fd25ab323f37e350191 Mon Sep 17 00:00:00 2001 From: ivan-83 Date: Tue, 17 Mar 2015 06:24:48 +0300 Subject: [PATCH] * tsmf: OSS now work, but only with ffmpeg, and sound is bad (like with alsa), ffmpeg code possible have bug with wrong resample --- channels/tsmf/client/oss/tsmf_oss.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/channels/tsmf/client/oss/tsmf_oss.c b/channels/tsmf/client/oss/tsmf_oss.c index 26cd7cc5f..855b50f04 100644 --- a/channels/tsmf/client/oss/tsmf_oss.c +++ b/channels/tsmf/client/oss/tsmf_oss.c @@ -122,7 +122,6 @@ static BOOL tsmf_oss_set_format(ITSMFAudioDevice *audio, UINT32 sample_rate, UIN int tmp; TSMFOssAudioDevice *oss = (TSMFOssAudioDevice*)audio; - WLog_INFO(TAG, "tsmf_oss_set_format"); if (oss == NULL || oss->pcm_handle == -1) return FALSE; @@ -136,17 +135,15 @@ static BOOL tsmf_oss_set_format(ITSMFAudioDevice *audio, UINT32 sample_rate, UIN tmp = channels; if (ioctl(oss->pcm_handle, SNDCTL_DSP_CHANNELS, &tmp) == -1) OSS_LOG_ERR("SNDCTL_DSP_CHANNELS failed", errno); - tmp = bits_per_sample; + tmp = sample_rate; if (ioctl(oss->pcm_handle, SNDCTL_DSP_SPEED, &tmp) == -1) OSS_LOG_ERR("SNDCTL_DSP_SPEED failed", errno); - tmp = 4096;//((bits_per_sample / 8) * channels * sample_rate); + tmp = ((bits_per_sample / 8) * channels * sample_rate); if (ioctl(oss->pcm_handle, SNDCTL_DSP_SETFRAGMENT, &tmp) == -1) OSS_LOG_ERR("SNDCTL_DSP_SETFRAGMENT failed", errno); DEBUG_TSMF("sample_rate %d channels %d bits_per_sample %d", sample_rate, channels, bits_per_sample); - WLog_INFO(TAG, "tsmf_oss_set_format: sample_rate %d channels %d bits_per_sample %d", - sample_rate, channels, bits_per_sample); return TRUE; } @@ -157,7 +154,6 @@ static BOOL tsmf_oss_play(ITSMFAudioDevice *audio, BYTE *data, UINT32 data_size) TSMFOssAudioDevice *oss = (TSMFOssAudioDevice*)audio; DEBUG_TSMF("tsmf_oss_play: data_size %d", data_size); - WLog_INFO(TAG, "tsmf_oss_play: data_size %d", data_size); if (oss == NULL || oss->pcm_handle == -1) return FALSE; @@ -177,7 +173,6 @@ static BOOL tsmf_oss_play(ITSMFAudioDevice *audio, BYTE *data, UINT32 data_size) } offset += status; } - WLog_INFO(TAG, "tsmf_oss_play"); free(data); return TRUE; @@ -191,7 +186,7 @@ static UINT64 tsmf_oss_get_latency(ITSMFAudioDevice *audio) { return 0; //latency = ((oss->data_size_last / (oss->bits_per_sample / 8)) * oss->sample_rate); - WLog_INFO(TAG, "latency: %zu", latency); + //WLog_INFO(TAG, "latency: %zu", latency); return latency; }