summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-09-02 20:13:12 +0200
committerwm4 <wm4@nowhere>2012-09-18 21:07:29 +0200
commit1ba5a8f283e3894158f12f025035903e13d0f8ae (patch)
tree7ff315850990353487a332cfc9f2917f6d43ed14 /libmpcodecs
parent1f5635d02cf1ad89025e5409fc05b718cbb04935 (diff)
downloadmpv-1ba5a8f283e3894158f12f025035903e13d0f8ae.tar.bz2
mpv-1ba5a8f283e3894158f12f025035903e13d0f8ae.tar.xz
rawaudio: use mplayer audio format for format option
The rawaudio demuxer had a rather hard to use way to set the audio format with the --rawaudio=format=value option. The user had to pass a numeric value, which then was set as wFormatTag member in the WAVEFORMATEX header. Make it use the mplayer audio format (the same as --af=format=value). Add a new internal pseudo audio codec tag, which is hopefully unused, which makes ad_pcm use the value in wFormatTag as internal mplayer audio format. Playing non-PCM formats is disabled. (At least AC3 can be played directly.)
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/ad_pcm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libmpcodecs/ad_pcm.c b/libmpcodecs/ad_pcm.c
index 6ddae6afeb..c265dfcd56 100644
--- a/libmpcodecs/ad_pcm.c
+++ b/libmpcodecs/ad_pcm.c
@@ -21,6 +21,8 @@
#include <unistd.h>
#include <stdbool.h>
+#include <libavutil/common.h>
+
#include "talloc.h"
#include "config.h"
#include "ad_internal.h"
@@ -119,6 +121,10 @@ static int init(sh_audio_t * sh_audio)
sh_audio->sample_format = AF_FORMAT_S32_LE;
sh_audio->samplesize = 4;
break;
+ case MKTAG('M', 'P', 'a', 'f'):
+ sh_audio->sample_format = h->wFormatTag;
+ sh_audio->samplesize = (af_fmt2bits(sh_audio->sample_format) + 7) / 8;
+ break;
default:
if (sh_audio->samplesize != 2)
sh_audio->sample_format = AF_FORMAT_U8;