Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 411292 Details for
Bug 559900
media-sound/madplay-0.15.2b-r1 : use the current ALSA API to support uclibc
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
madplay-0.15.2b-alsaapi.patch
madplay-0.15.2b-alsaapi.patch (text/plain), 2.91 KB, created by
René Rhéaume
on 2015-09-07 18:30:19 UTC
(
hide
)
Description:
madplay-0.15.2b-alsaapi.patch
Filename:
MIME Type:
Creator:
René Rhéaume
Created:
2015-09-07 18:30:19 UTC
Size:
2.91 KB
patch
obsolete
>--- madplay-0.15.2b/audio_alsa.c >+++ madplay-0.15.2b-alsaapi/audio_alsa.c >@@ -28,8 +28,6 @@ > > #include <errno.h> > >-#define ALSA_PCM_OLD_HW_PARAMS_API >-#define ALSA_PCM_OLD_SW_PARAMS_API > #include <alsa/asoundlib.h> > > #include <mad.h> >@@ -44,15 +42,15 @@ int channels = -1; > int bitdepth = -1; > int sample_size = -1; > >-int buffer_time = 500000; >-int period_time = 100000; >+unsigned int buffer_time= 500000; >+unsigned int period_time= 100000; > char *defaultdev = "plughw:0,0"; > > snd_pcm_hw_params_t *alsa_hwparams; > snd_pcm_sw_params_t *alsa_swparams; > >-snd_pcm_sframes_t buffer_size; >-snd_pcm_sframes_t period_size; >+snd_pcm_uframes_t buffer_size; >+snd_pcm_uframes_t period_size; > > snd_pcm_format_t alsa_format = -1; > snd_pcm_access_t alsa_access = SND_PCM_ACCESS_MMAP_INTERLEAVED; >@@ -67,7 +65,8 @@ int set_hwparams(snd_pcm_t *handle, > snd_pcm_access_t access) > { > int err, dir; >- >+ unsigned int rwval; >+ > /* choose all parameters */ > err = snd_pcm_hw_params_any(handle,params); > if (err < 0) { >@@ -87,29 +86,41 @@ int set_hwparams(snd_pcm_t *handle, > return err; > } > /* set the stream rate */ >- err = snd_pcm_hw_params_set_rate_near(handle, params, rate, 0); >+ rwval = rate; >+ err = snd_pcm_hw_params_set_rate_near(handle, params, &rwval, 0); > if (err < 0) { > printf("Rate %iHz not available for playback: %s\n", rate, snd_strerror(err)); > return err; > } >- if (err != rate) { >- printf("Rate doesn't match (requested %iHz, get %iHz)\n", rate, err); >+ if (rwval != rate) { >+ printf("Rate doesn't match (requested %iHz, get %iHz)\n", rate, rwval); > return -EINVAL; > } >+ else { >+ rate = rwval; >+ } > /* set buffer time */ >- err = snd_pcm_hw_params_set_buffer_time_near(handle, params, buffer_time, &dir); >+ err = snd_pcm_hw_params_set_buffer_time_near(handle, params, &buffer_time, &dir); > if (err < 0) { > printf("Unable to set buffer time %i for playback: %s\n", buffer_time, snd_strerror(err)); > return err; > } >- buffer_size = snd_pcm_hw_params_get_buffer_size(params); >+ err = snd_pcm_hw_params_get_buffer_size(params, &buffer_size); >+ if (err < 0) { >+ printf("Unable to get buffer size %i for playback: %s\n", buffer_size, snd_strerror(err)); >+ return err; >+ } > /* set period time */ >- err = snd_pcm_hw_params_set_period_time_near(handle, params, period_time, &dir); >+ err = snd_pcm_hw_params_set_period_time_near(handle, params, &period_time, &dir); > if (err < 0) { > printf("Unable to set period time %i for playback: %s\n", period_time, snd_strerror(err)); > return err; > } >- period_size = snd_pcm_hw_params_get_period_size(params, &dir); >+ err = snd_pcm_hw_params_get_period_size(params, &period_size, &dir); >+ if (err < 0) { >+ printf("Unable to get period size %i for playback: %s\n", period_size, snd_strerror(err)); >+ return err; >+ } > /* write the parameters to device */ > err = snd_pcm_hw_params(handle, params); > if (err < 0) { >Binary files madplay-0.15.2b/audio_alsa.o and madplay-0.15.2b-alsaapi/audio_alsa.o differ
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 559900
: 411292 |
411298