]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/siff.c
Release frame after decoding is done
[ffmpeg] / libavformat / siff.c
index 00b4eaa9dd484e51be4ed89b3d2b06094de1d6f3..1194f71bf6a288c58f9097c723d82c446777507e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Beam Software SIFF demuxer
- * Copyright (c) 2007 Konstantin Shishkov.
+ * Copyright (c) 2007 Konstantin Shishkov
  *
  * This file is part of FFmpeg.
  *
@@ -19,8 +19,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/intreadwrite.h"
 #include "avformat.h"
-#include "riff.h"
 
 enum SIFFTags{
     TAG_SIFF = MKTAG('S', 'I', 'F', 'F'),
@@ -60,11 +60,12 @@ typedef struct SIFFContext{
 
 static int siff_probe(AVProbeData *p)
 {
+    uint32_t tag = AV_RL32(p->buf + 8);
     /* check file header */
-    if (AV_RL32(p->buf) == TAG_SIFF)
-        return AVPROBE_SCORE_MAX;
-    else
+    if (AV_RL32(p->buf) != TAG_SIFF ||
+        (tag != TAG_VBV1 && tag != TAG_SOUN))
         return 0;
+    return AVPROBE_SCORE_MAX;
 }
 
 static int create_audio_stream(AVFormatContext *s, SIFFContext *c)
@@ -76,7 +77,7 @@ static int create_audio_stream(AVFormatContext *s, SIFFContext *c)
     ast->codec->codec_type      = CODEC_TYPE_AUDIO;
     ast->codec->codec_id        = CODEC_ID_PCM_U8;
     ast->codec->channels        = 1;
-    ast->codec->bits_per_sample = c->bits;
+    ast->codec->bits_per_coded_sample = c->bits;
     ast->codec->sample_rate     = c->rate;
     ast->codec->frame_size      = c->block_align;
     av_set_pts_info(ast, 16, 1, c->rate);
@@ -228,7 +229,7 @@ static int siff_read_packet(AVFormatContext *s, AVPacket *pkt)
 
 AVInputFormat siff_demuxer = {
     "siff",
-    "Beam Software SIFF",
+    NULL_IF_CONFIG_SMALL("Beam Software SIFF"),
     sizeof(SIFFContext),
     siff_probe,
     siff_read_header,