Changeset 34451 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Nov 29, 2010 11:00:53 AM (14 years ago)
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/alsa_stubs.c
r28800 r34451 80 80 PROXY_STUB(snd_strerror, const char *, (int errnum), (errnum)) 81 81 PROXY_STUB(snd_pcm_drop, int, (snd_pcm_t *pcm), (pcm)) 82 PROXY_STUB(snd_pcm_resume, int, (snd_pcm_t *pcm), (pcm)) 82 83 PROXY_STUB(snd_pcm_hw_params_get_buffer_size, int, 83 84 (const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val), … … 137 138 ELEMENT(snd_strerror), 138 139 ELEMENT(snd_pcm_drop), 140 ELEMENT(snd_pcm_resume), 139 141 ELEMENT(snd_pcm_hw_params_get_buffer_size), 140 142 ELEMENT(snd_pcm_hw_params_set_rate_near), -
trunk/src/VBox/Devices/Audio/alsaaudio.c
r33595 r34451 664 664 } 665 665 666 static int alsa_resume (snd_pcm_t *handle) 667 { 668 int err = snd_pcm_resume (handle); 669 if (err < 0) { 670 #ifndef VBOX 671 alsa_logerr (err, "Failed to resume handle %p\n", handle); 672 #endif 673 return -1; 674 } 675 return 0; 676 } 677 666 678 static snd_pcm_sframes_t alsa_get_avail (snd_pcm_t *handle) 667 679 { … … 741 753 continue; 742 754 755 case -ESTRPIPE: 756 /* stream is suspended and waiting for an 757 application recovery */ 758 if (alsa_resume (alsa->handle)) { 759 #ifndef VBOX 760 alsa_logerr (written, "Failed to write %d frames\n", len); 761 #else 762 LogRel(("ALSA: Failed to resume output stream\n")); 763 #endif 764 goto exit; 765 } 766 if (conf.verbose) { 767 dolog ("Resuming suspended output stream\n"); 768 } 769 continue; 770 743 771 case -EAGAIN: 744 772 goto exit; … … 953 981 } 954 982 955 if (!avail && (snd_pcm_state (alsa->handle) == SND_PCM_STATE_PREPARED)) { 956 avail = hw->samples; 983 if (!avail) { 984 snd_pcm_state_t state; 985 state = snd_pcm_state (alsa->handle); 986 switch (state) { 987 case SND_PCM_STATE_PREPARED: 988 avail = hw->samples; 989 break; 990 case SND_PCM_STATE_SUSPENDED: 991 /* stream is suspended and waiting for an application recovery */ 992 if (alsa_resume (alsa->handle)) { 993 #ifndef VBOX 994 dolog ("Failed to resume suspended input stream\n"); 995 #else 996 LogRel(("ALSA: Failed to resume input stream\n")); 997 #endif 998 return 0; 999 } 1000 if (conf.verbose) { 1001 dolog ("Resuming suspended input stream\n"); 1002 } 1003 break; 1004 default: 1005 if (conf.verbose) { 1006 dolog ("No frames available and ALSA state is %d\n", state); 1007 } 1008 return 0; 1009 } 957 1010 } 958 1011
Note:
See TracChangeset
for help on using the changeset viewer.