]> git.sesse.net Git - ffmpeg/blobdiff - libavdevice/jack_audio.c
dshow: save opened device reference so it may be properly closed
[ffmpeg] / libavdevice / jack_audio.c
index bdf5eb8f9e725ba21f7d8f791b1ede82b8c31ac3..42499d363b05f36ae6ea07e01319e5e8fd733075 100644 (file)
@@ -28,7 +28,8 @@
 #include "libavutil/fifo.h"
 #include "libavutil/opt.h"
 #include "libavcodec/avcodec.h"
-#include "libavformat/timefilter.h"
+#include "libavformat/avformat.h"
+#include "timefilter.h"
 #include "avdevice.h"
 
 /**
@@ -229,7 +230,7 @@ static int audio_read_header(AVFormatContext *context, AVFormatParameters *param
     if ((test = start_jack(context)))
         return test;
 
-    stream = av_new_stream(context, 0);
+    stream = avformat_new_stream(context, NULL);
     if (!stream) {
         stop_jack(self);
         return AVERROR(ENOMEM);
@@ -314,7 +315,7 @@ static int audio_read_close(AVFormatContext *context)
 
 #define OFFSET(x) offsetof(JackData, x)
 static const AVOption options[] = {
-    { "channels", "Number of audio channels.", OFFSET(nports), FF_OPT_TYPE_INT, { 2 }, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
+    { "channels", "Number of audio channels.", OFFSET(nports), AV_OPT_TYPE_INT, { 2 }, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
     { NULL },
 };
 
@@ -326,13 +327,12 @@ static const AVClass jack_indev_class = {
 };
 
 AVInputFormat ff_jack_demuxer = {
-    "jack",
-    NULL_IF_CONFIG_SMALL("JACK Audio Connection Kit"),
-    sizeof(JackData),
-    NULL,
-    audio_read_header,
-    audio_read_packet,
-    audio_read_close,
-    .flags = AVFMT_NOFILE,
-    .priv_class = &jack_indev_class,
+    .name           = "jack",
+    .long_name      = NULL_IF_CONFIG_SMALL("JACK Audio Connection Kit"),
+    .priv_data_size = sizeof(JackData),
+    .read_header    = audio_read_header,
+    .read_packet    = audio_read_packet,
+    .read_close     = audio_read_close,
+    .flags          = AVFMT_NOFILE,
+    .priv_class     = &jack_indev_class,
 };