]> git.sesse.net Git - ffmpeg/blobdiff - libavdevice/oss_audio.c
lavc: allow decoders to override frame parameters.
[ffmpeg] / libavdevice / oss_audio.c
index ef0ace94f05aebf8ed47a045dc305a4710906c8a..e3b9d67f6b109f27fcabedbb94e9ca72290d1279 100644 (file)
@@ -49,7 +49,7 @@ typedef struct {
     int sample_rate;
     int channels;
     int frame_size; /* in bytes ! */
-    enum CodecID codec_id;
+    enum AVCodecID codec_id;
     unsigned int flip_left : 1;
     uint8_t buffer[AUDIO_BLOCK_SIZE];
     int buffer_ptr;
@@ -104,10 +104,10 @@ static int audio_open(AVFormatContext *s1, int is_output, const char *audio_devi
 
     switch(tmp) {
     case AFMT_S16_LE:
-        s->codec_id = CODEC_ID_PCM_S16LE;
+        s->codec_id = AV_CODEC_ID_PCM_S16LE;
         break;
     case AFMT_S16_BE:
-        s->codec_id = CODEC_ID_PCM_S16BE;
+        s->codec_id = AV_CODEC_ID_PCM_S16BE;
         break;
     default:
         av_log(s1, AV_LOG_ERROR, "Soundcard does not support 16 bit sample format\n");
@@ -282,8 +282,8 @@ static int audio_read_close(AVFormatContext *s1)
 
 #if CONFIG_OSS_INDEV
 static const AVOption options[] = {
-    { "sample_rate", "", offsetof(AudioData, sample_rate), AV_OPT_TYPE_INT, {.dbl = 48000}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
-    { "channels",    "", offsetof(AudioData, channels),    AV_OPT_TYPE_INT, {.dbl = 2},     1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
+    { "sample_rate", "", offsetof(AudioData, sample_rate), AV_OPT_TYPE_INT, {.i64 = 48000}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
+    { "channels",    "", offsetof(AudioData, channels),    AV_OPT_TYPE_INT, {.i64 = 2},     1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
     { NULL },
 };
 
@@ -314,8 +314,8 @@ AVOutputFormat ff_oss_muxer = {
     /* XXX: we make the assumption that the soundcard accepts this format */
     /* XXX: find better solution with "preinit" method, needed also in
        other formats */
-    .audio_codec    = AV_NE(CODEC_ID_PCM_S16BE, CODEC_ID_PCM_S16LE),
-    .video_codec    = CODEC_ID_NONE,
+    .audio_codec    = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE),
+    .video_codec    = AV_CODEC_ID_NONE,
     .write_header   = audio_write_header,
     .write_packet   = audio_write_packet,
     .write_trailer  = audio_write_trailer,