[FFmpeg-cvslog] r17863 - trunk/libavdevice/alsa-audio-common.c

Ivo ivop
Wed Nov 18 20:26:30 CET 2009


On Saturday 07 March 2009, 19:17:13, lucabe wrote:
>      if (ctx->flags & AVFMT_FLAG_NONBLOCK) {
> -        flags = O_NONBLOCK;
> +        flags = SND_PCM_NONBLOCK;
>      }
>      res = snd_pcm_open(&h, audio_device, mode, flags);

This broke alsa playback. Fix:

diff --git a/libavdevice/alsa-audio-common.c 
b/libavdevice/alsa-audio-common.c
index f1d78b0..1c31d10 100644
--- a/libavdevice/alsa-audio-common.c
+++ b/libavdevice/alsa-audio-common.c
@@ -67,7 +67,7 @@ av_cold int ff_alsa_open(AVFormatContext *ctx, 
snd_pcm_stream_
     }
     s->frame_size = av_get_bits_per_sample(*codec_id) / 8 * channels;
 
-    if (ctx->flags & AVFMT_FLAG_NONBLOCK) {
+    if (ctx->flags & AVFMT_FLAG_NONBLOCK && mode == SND_PCM_STREAM_CAPTURE) 
{
         flags = SND_PCM_NONBLOCK;
     }
     res = snd_pcm_open(&h, audio_device, mode, flags);


Regards,
--Ivo



More information about the ffmpeg-cvslog mailing list