[MPlayer-dev-eng] [PATCH] hack for shorten support

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Mon Oct 9 22:19:05 CEST 2006


Hello,
the attached patch is an alternative proposal to add shorten support to
MPlayer in case the suggestion on ffmpeg-devel is not accepted.
What makes it hackish is that for dynamic libavformat we are missing
some important headers (actually the same problem already existed before
and also with muxer_lavf and was worked around by adding extern function
declarations).

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: libmpdemux/demux_lavf.c
===================================================================
--- libmpdemux/demux_lavf.c	(revision 20143)
+++ libmpdemux/demux_lavf.c	(working copy)
@@ -33,8 +33,14 @@
 #ifdef USE_LIBAVFORMAT_SO
 #include <ffmpeg/avformat.h>
 #include <ffmpeg/opt.h>
+typedef struct CodecTag {
+    int id;
+    unsigned int tag;
+    unsigned int invalid_asf : 1;
+} CodecTag;
 #else
 #include "avformat.h"
+#include "riff.h"
 #include "avi.h"
 #include "opt.h"
 #endif
@@ -65,6 +71,11 @@
 
 int64_t ff_gcd(int64_t a, int64_t b);
 
+const CodecTag mp_wav_tags[] = {
+    { CODEC_ID_SHORTEN, MKTAG('s', 'h', 'r', 'n') },
+    { 0, 0 },
+};
+
 static int mp_open(URLContext *h, const char *filename, int flags){
     return 0;
 }
@@ -213,6 +224,8 @@
             priv->audio_streams++;
             if(!codec->codec_tag)
                 codec->codec_tag= codec_get_wav_tag(codec->codec_id);
+            if(!codec->codec_tag)
+                codec->codec_tag= codec_get_tag(mp_wav_tags, codec->codec_id);
             wf->wFormatTag= codec->codec_tag;
             wf->nChannels= codec->channels;
             wf->nSamplesPerSec= codec->sample_rate;
Index: etc/codecs.conf
===================================================================
--- etc/codecs.conf	(revision 20138)
+++ etc/codecs.conf	(working copy)
@@ -2431,6 +2431,13 @@
   driver ffmpeg
   dll "wavpack"
 
+audiocodec ffshorten
+  info "FFmpeg shorten audio decoder"
+  status working
+  fourcc shrn
+  driver ffmpeg
+  dll "shorten"
+
 audiocodec pcm
   info "Uncompressed PCM"
   status working


More information about the MPlayer-dev-eng mailing list