]> git.sesse.net Git - ffmpeg/blobdiff - libavdevice/sndio_dec.c
lavfi/gradfun: fix rounding in MMX code.
[ffmpeg] / libavdevice / sndio_dec.c
index 2690ee395cdadd3abf37f17c05e3f360e40f1d61..58caaa1f447f5f84faf401316b5937abd5ae86ed 100644 (file)
 #include <sndio.h>
 
 #include "libavformat/avformat.h"
+#include "libavformat/internal.h"
 #include "libavutil/opt.h"
+#include "libavutil/time.h"
 
 #include "sndio_common.h"
 
-static av_cold int audio_read_header(AVFormatContext *s1,
-                                     AVFormatParameters *ap)
+static av_cold int audio_read_header(AVFormatContext *s1)
 {
     SndioData *s = s1->priv_data;
     AVStream *st;
     int ret;
 
-#if FF_API_FORMAT_PARAMETERS
-    if (ap->sample_rate > 0)
-        s->sample_rate = ap->sample_rate;
-    if (ap->channels > 0)
-        s->channels = ap->channels;
-#endif
-
-    st = av_new_stream(s1, 0);
+    st = avformat_new_stream(s1, NULL);
     if (!st)
         return AVERROR(ENOMEM);
 
@@ -55,7 +49,7 @@ static av_cold int audio_read_header(AVFormatContext *s1,
     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 */
 
     return 0;
 }
@@ -100,8 +94,8 @@ static av_cold int audio_read_close(AVFormatContext *s1)
 }
 
 static const AVOption options[] = {
-    { "sample_rate", "", offsetof(SndioData, sample_rate), FF_OPT_TYPE_INT, {.dbl = 48000}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
-    { "channels",    "", offsetof(SndioData, channels),    FF_OPT_TYPE_INT, {.dbl = 2},     1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
+    { "sample_rate", "", offsetof(SndioData, sample_rate), AV_OPT_TYPE_INT, {.i64 = 48000}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
+    { "channels",    "", offsetof(SndioData, channels),    AV_OPT_TYPE_INT, {.i64 = 2},     1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
     { NULL },
 };