[Ffmpeg-devel] [RFC] Smacker support in MPlayer

Kostya kostya.shishkov
Tue May 16 05:24:58 CEST 2006


Here is small patch which enables me to watch Smacker videos in MPlayer
(sample config attached).
May I apply it or are some objections there?
-------------- next part --------------
diff -ru ../ffmpeg-cvs/libavcodec/smacker.c ./libavcodec/smacker.c
--- ../ffmpeg-cvs/libavcodec/smacker.c	2006-05-16 03:02:47.000000000 +0300
+++ ./libavcodec/smacker.c	2006-05-16 03:09:20.000000000 +0300
@@ -425,7 +425,7 @@
             break;
         case SMK_BLK_FULL:
             mode = 0;
-            if(avctx->codec_tag != 0) { // In case of Smacker v4 we have three modes
+            if(avctx->codec_tag == MKTAG('S', 'M', 'K', '4')) { // In case of Smacker v4 we have three modes
                 if(get_bits1(&gb)) mode = 1;
                 else if(get_bits1(&gb)) mode = 2;
             }
diff -ru ../ffmpeg-cvs/libavformat/smacker.c ./libavformat/smacker.c
--- ../ffmpeg-cvs/libavformat/smacker.c	2006-05-16 03:02:51.000000000 +0300
+++ ./libavformat/smacker.c	2006-05-16 03:06:21.000000000 +0300
@@ -156,7 +156,7 @@
     st->codec->pix_fmt = PIX_FMT_PAL8;
     st->codec->codec_type = CODEC_TYPE_VIDEO;
     st->codec->codec_id = CODEC_ID_SMACKVIDEO;
-    st->codec->codec_tag = smk->is_ver4;
+    st->codec->codec_tag = smk->magic;
     /* Smacker uses 100000 as internal timebase */
     if(smk->pts_inc < 0)
         smk->pts_inc = -smk->pts_inc;
@@ -174,7 +174,7 @@
             av_set_pts_info(ast[i], 33, smk->pts_inc, tbase);
             ast[i]->codec->codec_type = CODEC_TYPE_AUDIO;
             ast[i]->codec->codec_id = (smk->rates[i] & SMK_AUD_PACKED) ? CODEC_ID_SMACKAUDIO : CODEC_ID_PCM_U8;
-            ast[i]->codec->codec_tag = 0;
+            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;
-------------- next part --------------
videocodec ffsmkvid
  info "FFmpeg Smacker Video"
  status working
  fourcc SMK2
  fourcc SMK4
  out BGR8
  driver ffmpeg
  dll "smackvid"

audiocodec ffsmkaud
  info "FFmpeg Smacker Audio"
  status buggy
  fourcc SMKA
  driver ffmpeg
  dll "smackaud"



More information about the ffmpeg-devel mailing list