diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-07-10 04:28:50 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-07-10 04:28:50 +0200 |
commit | 2f56a97f2488146f209de415e3338f7e597c5719 (patch) | |
tree | dc5738f578f616d5af685391e82220452b3fbb3e /libavdevice | |
parent | a7d3a51dd1efa3073cc9d419a73f709f784ce267 (diff) | |
parent | 7f7dc4fb55904e7b51b78ebca746c6755fc9770c (diff) | |
download | ffmpeg-2f56a97f2488146f209de415e3338f7e597c5719.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master: (22 commits)
H.264: fix filter_mb_fast with 4:4:4 + 8x8dct
alsa: limit buffer_size to 32768 frames.
alsa: fallback to buffer_size/4 for period_size.
doc: replace @pxref by @ref where appropriate
mpeg1video: don't abort if thread_count is too high.
segafilm: add support for videos with cri adx adpcm
gxf: Fix 25 fps DV material in GXF being misdetected as 50 fps
libxvid: Add const qualifier to silence compiler warning.
H.264: improve qp_thresh check
H.264: use fill_rectangle in CABAC decoding
H.264: Remove redundant hl_motion_16/8 code
H.264: merge fill_rectangle into P-SKIP MV prediction, to match B-SKIP
H.264: faster P-SKIP decoding
H.264: av_always_inline some more functions
H.264: Add x86 assembly for 10-bit H.264 predict functions
swscale: rename uv_off/uv_off2 to uv_off_px/byte.
swscale: implement error dithering in planarCopyWrapper.
swscale: error dithering for 16/9/10-bit to 8-bit.
swscale: fix overflow in 16-bit vertical scaling.
swscale: fix crash in 8-bpc bilinear output without alpha.
...
Conflicts:
doc/developer.texi
libavdevice/alsa-audio.h
libavformat/gxf.c
libswscale/swscale.c
libswscale/swscale_internal.h
libswscale/swscale_unscaled.c
libswscale/x86/swscale_template.c
tests/ref/lavfi/pixdesc
tests/ref/lavfi/pixfmts_copy
tests/ref/lavfi/pixfmts_crop
tests/ref/lavfi/pixfmts_hflip
tests/ref/lavfi/pixfmts_null
tests/ref/lavfi/pixfmts_scale
tests/ref/lavfi/pixfmts_vflip
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavdevice')
-rw-r--r-- | libavdevice/alsa-audio-common.c | 3 | ||||
-rw-r--r-- | libavdevice/alsa-audio.h | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/libavdevice/alsa-audio-common.c b/libavdevice/alsa-audio-common.c index 6188721f48..0943ab030a 100644 --- a/libavdevice/alsa-audio-common.c +++ b/libavdevice/alsa-audio-common.c @@ -260,6 +260,7 @@ av_cold int ff_alsa_open(AVFormatContext *ctx, snd_pcm_stream_t mode, } snd_pcm_hw_params_get_buffer_size_max(hw_params, &buffer_size); + buffer_size = FFMIN(buffer_size, ALSA_BUFFER_SIZE_MAX); /* TODO: maybe use ctx->max_picture_buffer somehow */ res = snd_pcm_hw_params_set_buffer_size_near(h, hw_params, &buffer_size); if (res < 0) { @@ -269,6 +270,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", diff --git a/libavdevice/alsa-audio.h b/libavdevice/alsa-audio.h index 0226632479..ab60e73c59 100644 --- a/libavdevice/alsa-audio.h +++ b/libavdevice/alsa-audio.h @@ -43,6 +43,8 @@ typedef void (*ff_reorder_func)(const void *, void *, int); +#define ALSA_BUFFER_SIZE_MAX 32768 + typedef struct { AVClass *class; snd_pcm_t *h; |