]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/smacker.c
Support demuxing Blu-ray subtitles in matroska files.
[ffmpeg] / libavformat / smacker.c
index 460ed0c93b17d1d7bee6eec8efdc6018fbfd57d7..8ec28bcd3b7cb76d3b6e2dd33453b9e3c565ba9f 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Smacker demuxer
- * Copyright (c) 2006 Konstantin Shishkov.
+ * Copyright (c) 2006 Konstantin Shishkov
  *
  * This file is part of FFmpeg.
  *
@@ -24,6 +24,7 @@
  */
 
 #include "libavutil/bswap.h"
+#include "libavutil/intreadwrite.h"
 #include "avformat.h"
 
 #define SMACKER_PAL 0x01
@@ -64,7 +65,7 @@ typedef struct SmackerContext {
     int buf_sizes[7];
     int stream_id[7];
     int curstream;
-    offset_t nextpos;
+    int64_t nextpos;
     int64_t aud_pts[7];
 } SmackerContext;
 
@@ -179,11 +180,11 @@ static int smacker_read_header(AVFormatContext *s, AVFormatParameters *ap)
             ast[i]->codec->codec_tag = MKTAG('S', 'M', 'K', 'A');
             ast[i]->codec->channels = (smk->rates[i] & SMK_AUD_STEREO) ? 2 : 1;
             ast[i]->codec->sample_rate = smk->rates[i] & 0xFFFFFF;
-            ast[i]->codec->bits_per_sample = (smk->rates[i] & SMK_AUD_16BITS) ? 16 : 8;
-            if(ast[i]->codec->bits_per_sample == 16 && ast[i]->codec->codec_id == CODEC_ID_PCM_U8)
+            ast[i]->codec->bits_per_coded_sample = (smk->rates[i] & SMK_AUD_16BITS) ? 16 : 8;
+            if(ast[i]->codec->bits_per_coded_sample == 16 && ast[i]->codec->codec_id == CODEC_ID_PCM_U8)
                 ast[i]->codec->codec_id = CODEC_ID_PCM_S16LE;
             av_set_pts_info(ast[i], 64, 1, ast[i]->codec->sample_rate
-                    * ast[i]->codec->channels * ast[i]->codec->bits_per_sample / 8);
+                    * ast[i]->codec->channels * ast[i]->codec->bits_per_coded_sample / 8);
         }
     }
 
@@ -336,7 +337,7 @@ static int smacker_read_close(AVFormatContext *s)
 
 AVInputFormat smacker_demuxer = {
     "smk",
-    "Smacker Video",
+    NULL_IF_CONFIG_SMALL("Smacker video"),
     sizeof(SmackerContext),
     smacker_probe,
     smacker_read_header,