OSDN Git Service
(root)
/
android-x86
/
external-ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4c98976
)
alsa: fallback to buffer_size/4 for period_size.
author
Justin Ruggles
<justin.ruggles@gmail.com>
Wed, 22 Jun 2011 19:33:56 +0000
(15:33 -0400)
committer
Justin Ruggles
<justin.ruggles@gmail.com>
Sat, 9 Jul 2011 20:00:56 +0000
(16:00 -0400)
buffer_size/4 is the value used by aplay. This fixes output to null
devices, e.g. writing ALSA output to a file.
libavdevice/alsa-audio-common.c
patch
|
blob
|
history
diff --git
a/libavdevice/alsa-audio-common.c
b/libavdevice/alsa-audio-common.c
index
4cfc6e9
..
1e945fc
100644
(file)
--- a/
libavdevice/alsa-audio-common.c
+++ b/
libavdevice/alsa-audio-common.c
@@
-269,6
+269,8
@@
av_cold int ff_alsa_open(AVFormatContext *ctx, snd_pcm_stream_t mode,
}
snd_pcm_hw_params_get_period_size_min(hw_params, &period_size, NULL);
+ if (!period_size)
+ period_size = buffer_size / 4;
res = snd_pcm_hw_params_set_period_size_near(h, hw_params, &period_size, NULL);
if (res < 0) {
av_log(ctx, AV_LOG_ERROR, "cannot set ALSA period size (%s)\n",