Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
4787c71d
Q
qemu
项目概览
openeuler
/
qemu
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4787c71d
编写于
11月 11, 2005
作者:
B
bellard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug fix (malc)
git-svn-id:
svn://svn.savannah.nongnu.org/qemu/trunk@1619
c046a42c-6fe2-441c-8c8c-71466251a162
上级
541e0844
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
34 addition
and
31 deletion
+34
-31
audio/alsaaudio.c
audio/alsaaudio.c
+33
-30
audio/audio_int.h
audio/audio_int.h
+1
-1
未找到文件。
audio/alsaaudio.c
浏览文件 @
4787c71d
...
@@ -570,36 +570,39 @@ static int alsa_run_out (HWVoiceOut *hw)
...
@@ -570,36 +570,39 @@ static int alsa_run_out (HWVoiceOut *hw)
hw
->
clip
(
dst
,
src
,
convert_samples
);
hw
->
clip
(
dst
,
src
,
convert_samples
);
again:
while
(
convert_samples
)
{
written
=
snd_pcm_writei
(
alsa
->
handle
,
dst
,
convert_samples
);
written
=
snd_pcm_writei
(
alsa
->
handle
,
dst
,
convert_samples
);
if
(
written
<
0
)
{
switch
(
written
)
{
case
-
EPIPE
:
if
(
!
alsa_recover
(
alsa
->
handle
))
{
goto
again
;
}
dolog
(
"Failed to write %d frames to %p, handle %p not prepared
\n
"
,
convert_samples
,
dst
,
alsa
->
handle
);
goto
exit
;
case
-
EAGAIN
:
if
(
written
<
0
)
{
goto
again
;
switch
(
written
)
{
case
-
EPIPE
:
if
(
!
alsa_recover
(
alsa
->
handle
))
{
continue
;
}
dolog
(
"Failed to write %d frames to %p, "
"handle %p not prepared
\n
"
,
convert_samples
,
dst
,
alsa
->
handle
);
goto
exit
;
default:
case
-
EAGAIN
:
alsa_logerr
(
written
,
"Failed to write %d frames to %p
\n
"
,
continue
;
convert_samples
,
dst
);
goto
exit
;
default:
alsa_logerr
(
written
,
"Failed to write %d frames to %p
\n
"
,
convert_samples
,
dst
);
goto
exit
;
}
}
}
}
mixeng_clear
(
src
,
written
);
mixeng_clear
(
src
,
written
);
rpos
=
(
rpos
+
written
)
%
hw
->
samples
;
rpos
=
(
rpos
+
written
)
%
hw
->
samples
;
samples
-=
written
;
samples
-=
written
;
convert_samples
-=
written
;
dst
=
advance
(
dst
,
written
<<
hw
->
info
.
shift
);
src
+=
written
;
}
}
}
exit:
exit:
...
@@ -661,8 +664,8 @@ static int alsa_init_out (HWVoiceOut *hw, audsettings_t *as)
...
@@ -661,8 +664,8 @@ static int alsa_init_out (HWVoiceOut *hw, audsettings_t *as)
alsa
->
pcm_buf
=
audio_calloc
(
AUDIO_FUNC
,
obt
.
samples
,
1
<<
hw
->
info
.
shift
);
alsa
->
pcm_buf
=
audio_calloc
(
AUDIO_FUNC
,
obt
.
samples
,
1
<<
hw
->
info
.
shift
);
if
(
!
alsa
->
pcm_buf
)
{
if
(
!
alsa
->
pcm_buf
)
{
dolog
(
"Could not allocate DAC buffer (%d bytes)
\n
"
,
dolog
(
"Could not allocate DAC buffer (%d
samples, each %d
bytes)
\n
"
,
hw
->
samples
<<
hw
->
info
.
shift
);
hw
->
samples
,
1
<<
hw
->
info
.
shift
);
alsa_anal_close
(
&
handle
);
alsa_anal_close
(
&
handle
);
return
-
1
;
return
-
1
;
}
}
...
@@ -751,8 +754,8 @@ static int alsa_init_in (HWVoiceIn *hw, audsettings_t *as)
...
@@ -751,8 +754,8 @@ static int alsa_init_in (HWVoiceIn *hw, audsettings_t *as)
alsa
->
pcm_buf
=
audio_calloc
(
AUDIO_FUNC
,
hw
->
samples
,
1
<<
hw
->
info
.
shift
);
alsa
->
pcm_buf
=
audio_calloc
(
AUDIO_FUNC
,
hw
->
samples
,
1
<<
hw
->
info
.
shift
);
if
(
!
alsa
->
pcm_buf
)
{
if
(
!
alsa
->
pcm_buf
)
{
dolog
(
"Could not allocate ADC buffer (%d bytes)
\n
"
,
dolog
(
"Could not allocate ADC buffer (%d
samples, each %d
bytes)
\n
"
,
hw
->
samples
<<
hw
->
info
.
shift
);
hw
->
samples
,
1
<<
hw
->
info
.
shift
);
alsa_anal_close
(
&
handle
);
alsa_anal_close
(
&
handle
);
return
-
1
;
return
-
1
;
}
}
...
...
audio/audio_int.h
浏览文件 @
4787c71d
...
@@ -216,7 +216,7 @@ static inline int audio_need_to_swap_endian (int endianness)
...
@@ -216,7 +216,7 @@ static inline int audio_need_to_swap_endian (int endianness)
#if defined __GNUC__
#if defined __GNUC__
#define GCC_ATTR __attribute__ ((__unused__, __format__ (__printf__, 1, 2)))
#define GCC_ATTR __attribute__ ((__unused__, __format__ (__printf__, 1, 2)))
#define INIT_FIELD(f) . f
#define INIT_FIELD(f) . f
#define GCC_FMT_ATTR(n, m) __attribute__ ((__format__ (
printf
, n, m)))
#define GCC_FMT_ATTR(n, m) __attribute__ ((__format__ (
__printf__
, n, m)))
#else
#else
#define GCC_ATTR
/**/
#define GCC_ATTR
/**/
#define INIT_FIELD(f)
/**/
#define INIT_FIELD(f)
/**/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录