Merge commit 'b586903ae1b89e2d8b99c79f33cabe9b3ca03784'
[ffmpeg.git] / libavdevice / oss_dec.c
index 156d6ae..6fef96a 100644 (file)
 
 #include <stdint.h>
 
-#if HAVE_SOUNDCARD_H
-#include <soundcard.h>
-#else
-#include <sys/soundcard.h>
-#endif
-
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 #include <fcntl.h>
 #include <sys/ioctl.h>
+#include <sys/soundcard.h>
 
 #include "libavutil/internal.h"
 #include "libavutil/opt.h"
@@ -63,10 +58,10 @@ static int audio_read_header(AVFormatContext *s1)
     }
 
     /* take real parameters */
-    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id = s->codec_id;
-    st->codec->sample_rate = s->sample_rate;
-    st->codec->channels = s->channels;
+    st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
+    st->codecpar->codec_id = s->codec_id;
+    st->codecpar->sample_rate = s->sample_rate;
+    st->codecpar->channels = s->channels;
 
     avpriv_set_pts_info(st, 64, 1, 1000000);  /* 64 bits pts in us */
     return 0;
@@ -84,7 +79,7 @@ static int audio_read_packet(AVFormatContext *s1, AVPacket *pkt)
 
     ret = read(s->fd, pkt->data, pkt->size);
     if (ret <= 0){
-        av_free_packet(pkt);
+        av_packet_unref(pkt);
         pkt->size = 0;
         if (ret<0)  return AVERROR(errno);
         else        return AVERROR_EOF;