*/
/**
- * @file libavdevice/alsa-audio-common.c
+ * @file
* ALSA input and output: common code
* @author Luca Abeni ( lucabe72 email it )
* @author Benoit Fouet ( benoit fouet free fr )
* @author Nicolas George ( nicolas george normalesup org )
*/
-#include "libavformat/avformat.h"
#include <alsa/asoundlib.h>
+#include "libavformat/avformat.h"
#include "alsa-audio.h"
}
}
-av_cold int ff_alsa_open(AVFormatContext *ctx, int mode,
+av_cold int ff_alsa_open(AVFormatContext *ctx, snd_pcm_stream_t mode,
unsigned int *sample_rate,
- int channels, int *codec_id)
+ int channels, enum CodecID *codec_id)
{
AlsaData *s = ctx->priv_data;
const char *audio_device;
if (res < 0) {
av_log(ctx, AV_LOG_ERROR, "cannot open audio device %s (%s)\n",
audio_device, snd_strerror(res));
- return AVERROR_IO;
+ return AVERROR(EIO);
}
res = snd_pcm_hw_params_malloc(&hw_params);
snd_pcm_hw_params_free(hw_params);
fail1:
snd_pcm_close(h);
- return AVERROR_IO;
+ return AVERROR(EIO);
}
av_cold int ff_alsa_close(AVFormatContext *s1)
if (err < 0) {
av_log(s1, AV_LOG_ERROR, "cannot recover from underrun (snd_pcm_prepare failed: %s)\n", snd_strerror(err));
- return AVERROR_IO;
+ return AVERROR(EIO);
}
} else if (err == -ESTRPIPE) {
av_log(s1, AV_LOG_ERROR, "-ESTRPIPE... Unsupported!\n");