]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/au.c
Include the correct video4linux2 header
[ffmpeg] / libavformat / au.c
index 6ce326f57a60cd18e5e0c1815ab9e9faa5598f50..2d603f5f77c85561a1dab381c9e18095c6e2bdaf 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
  * AU encoder and decoder
  * Copyright (c) 2001 Fabrice Bellard.
  *
@@ -14,7 +14,7 @@
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
@@ -39,7 +39,7 @@ static const CodecTag codec_au_tags[] = {
     { 0, 0 },
 };
 
-#ifdef CONFIG_ENCODERS
+#ifdef CONFIG_MUXERS
 /* AUDIO_FILE header */
 static int put_au_header(ByteIOContext *pb, AVCodecContext *enc)
 {
@@ -63,7 +63,7 @@ static int au_write_header(AVFormatContext *s)
     s->priv_data = NULL;
 
     /* format header */
-    if (put_au_header(pb, &s->streams[0]->codec) < 0) {
+    if (put_au_header(pb, s->streams[0]->codec) < 0) {
         return -1;
     }
 
@@ -97,7 +97,7 @@ static int au_write_trailer(AVFormatContext *s)
 
     return 0;
 }
-#endif //CONFIG_ENCODERS
+#endif //CONFIG_MUXERS
 
 static int au_probe(AVProbeData *p)
 {
@@ -127,11 +127,11 @@ static int au_read_header(AVFormatContext *s,
         return -1;
     size = get_be32(pb); /* header size */
     get_be32(pb); /* data size */
-    
+
     id = get_be32(pb);
     rate = get_be32(pb);
     channels = get_be32(pb);
-    
+
     codec = codec_get_id(codec_au_tags, id);
 
     if (size >= 24) {
@@ -143,11 +143,12 @@ static int au_read_header(AVFormatContext *s,
     st = av_new_stream(s, 0);
     if (!st)
         return -1;
-    st->codec.codec_type = CODEC_TYPE_AUDIO;
-    st->codec.codec_tag = id;
-    st->codec.codec_id = codec;
-    st->codec.channels = channels;
-    st->codec.sample_rate = rate;
+    st->codec->codec_type = CODEC_TYPE_AUDIO;
+    st->codec->codec_tag = id;
+    st->codec->codec_id = codec;
+    st->codec->channels = channels;
+    st->codec->sample_rate = rate;
+    av_set_pts_info(st, 64, 1, rate);
     return 0;
 }
 
@@ -160,14 +161,11 @@ static int au_read_packet(AVFormatContext *s,
 
     if (url_feof(&s->pb))
         return AVERROR_IO;
-    if (av_new_packet(pkt, MAX_SIZE))
+    ret= av_get_packet(&s->pb, pkt, MAX_SIZE);
+    if (ret < 0)
         return AVERROR_IO;
     pkt->stream_index = 0;
-    pkt->flags |= PKT_FLAG_KEY;    
 
-    ret = get_buffer(&s->pb, pkt->data, pkt->size);
-    if (ret < 0)
-        av_free_packet(pkt);
     /* note: we need to modify the packet size here to handle the last
        packet */
     pkt->size = ret;
@@ -190,7 +188,7 @@ static AVInputFormat au_iformat = {
     pcm_read_seek,
 };
 
-#ifdef CONFIG_ENCODERS
+#ifdef CONFIG_MUXERS
 static AVOutputFormat au_oformat = {
     "au",
     "SUN AU Format",
@@ -203,13 +201,13 @@ static AVOutputFormat au_oformat = {
     au_write_packet,
     au_write_trailer,
 };
-#endif //CONFIG_ENCODERS
+#endif //CONFIG_MUXERS
 
 int au_init(void)
 {
     av_register_input_format(&au_iformat);
-#ifdef CONFIG_ENCODERS
+#ifdef CONFIG_MUXERS
     av_register_output_format(&au_oformat);
-#endif //CONFIG_ENCODERS
+#endif //CONFIG_MUXERS
     return 0;
 }