]> git.sesse.net Git - ffmpeg/blobdiff - libavdevice/alsa-audio-dec.c
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavdevice / alsa-audio-dec.c
index ac3840acbc9567989ef9d5ec1a0c56e9d928a35f..bb9d233a4e95625bc8c5b1b827cf0b63cb844d60 100644 (file)
@@ -46,6 +46,7 @@
  */
 
 #include <alsa/asoundlib.h>
+#include "libavformat/internal.h"
 #include "libavutil/opt.h"
 #include "libavutil/mathematics.h"
 
@@ -61,7 +62,7 @@ static av_cold int audio_read_header(AVFormatContext *s1,
     enum CodecID codec_id;
     double o;
 
-    st = av_new_stream(s1, 0);
+    st = avformat_new_stream(s1, NULL);
     if (!st) {
         av_log(s1, AV_LOG_ERROR, "Cannot add stream\n");
 
@@ -80,7 +81,7 @@ static av_cold int audio_read_header(AVFormatContext *s1,
     st->codec->codec_id    = codec_id;
     st->codec->sample_rate = s->sample_rate;
     st->codec->channels    = s->channels;
-    av_set_pts_info(st, 64, 1, 1000000);  /* 64 bits pts in us */
+    avpriv_set_pts_info(st, 64, 1, 1000000);  /* 64 bits pts in us */
     o = 2 * M_PI * s->period_size / s->sample_rate * 1.5; // bandwidth: 1.5Hz
     s->timefilter = ff_timefilter_new(1000000.0 / s->sample_rate,
                                       sqrt(2 * o), o * o);
@@ -132,8 +133,8 @@ static int audio_read_packet(AVFormatContext *s1, AVPacket *pkt)
 }
 
 static const AVOption options[] = {
-    { "sample_rate", "", offsetof(AlsaData, sample_rate), FF_OPT_TYPE_INT, {.dbl = 48000}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
-    { "channels",    "", offsetof(AlsaData, channels),    FF_OPT_TYPE_INT, {.dbl = 2},     1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
+    { "sample_rate", "", offsetof(AlsaData, sample_rate), AV_OPT_TYPE_INT, {.dbl = 48000}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
+    { "channels",    "", offsetof(AlsaData, channels),    AV_OPT_TYPE_INT, {.dbl = 2},     1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
     { NULL },
 };