changeset 63:8329ba7cbd01 libavformat

raw ac3 auto detects parameters
author bellard
date Sun, 09 Feb 2003 18:07:16 +0000
parents 56a6676125b4
children b0e0eb595e29
files raw.c
diffstat 1 files changed, 17 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/raw.c	Sun Feb 09 18:06:23 2003 +0000
+++ b/raw.c	Sun Feb 09 18:07:16 2003 +0000
@@ -122,6 +122,22 @@
     return 0;
 }
 
+/* ac3 read */
+static int ac3_read_header(AVFormatContext *s,
+                           AVFormatParameters *ap)
+{
+    AVStream *st;
+
+    st = av_new_stream(s, 0);
+    if (!st)
+        return AVERROR_NOMEM;
+
+    st->codec.codec_type = CODEC_TYPE_AUDIO;
+    st->codec.codec_id = CODEC_ID_AC3;
+    /* the parameters will be extracted from the compressed bitstream */
+    return 0;
+}
+
 /* mpeg1/h263 input */
 static int video_read_header(AVFormatContext *s,
                              AVFormatParameters *ap)
@@ -207,11 +223,10 @@
     "raw ac3",
     0,
     NULL,
-    raw_read_header,
+    ac3_read_header,
     raw_read_packet,
     raw_read_close,
     .extensions = "ac3",
-    .value = CODEC_ID_AC3,
 };
 
 AVOutputFormat ac3_oformat = {