diff raw.c @ 686:e2687b784c3a libavformat

shorten decoder by (Jeff Muizelaar <jrmuizel gmail com>)
author michael
date Sat, 26 Feb 2005 03:36:04 +0000
parents 76e36d97a27a
children af4e24d6310c
line wrap: on
line diff
--- a/raw.c	Fri Feb 25 11:15:31 2005 +0000
+++ b/raw.c	Sat Feb 26 03:36:04 2005 +0000
@@ -188,6 +188,21 @@
     return 0;
 }
 
+static int shorten_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_SHORTEN;
+    st->need_parsing = 1;
+    /* the parameters will be extracted from the compressed bitstream */
+    return 0;
+}
+
 /* dts read */
 static int dts_read_header(AVFormatContext *s,
                            AVFormatParameters *ap)
@@ -295,6 +310,17 @@
     return 0;
 }
 
+AVInputFormat shorten_iformat = {
+    "shn",
+    "raw shn",
+    0,
+    NULL,
+    shorten_read_header,
+    raw_read_partial_packet,
+    raw_read_close,
+    .extensions = "shn",
+};
+
 AVInputFormat ac3_iformat = {
     "ac3",
     "raw ac3",
@@ -672,6 +698,9 @@
 
 int raw_init(void)
 {
+
+    av_register_input_format(&shorten_iformat);
+
     av_register_input_format(&ac3_iformat);
     av_register_output_format(&ac3_oformat);