summaryrefslogtreecommitdiffstats
path: root/mencoder.c
diff options
context:
space:
mode:
authorranma <ranma@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-07-02 19:00:13 +0000
committerranma <ranma@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-07-02 19:00:13 +0000
commita123c6be4c9c8baa0165bd37b37e34eb34efe2e5 (patch)
treed16b7bacd7b4e27d518bda36dc9d952e2f1d5262 /mencoder.c
parentf47b576d49de8ad257d9c24131070b43b072dbd0 (diff)
downloadmpv-a123c6be4c9c8baa0165bd37b37e34eb34efe2e5.tar.bz2
mpv-a123c6be4c9c8baa0165bd37b37e34eb34efe2e5.tar.xz
Check for WAVEFORMAT.wFormatTag overflows and allow user to override the tag with -fafmttag
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15889 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mencoder.c')
-rw-r--r--mencoder.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/mencoder.c b/mencoder.c
index f252ba2bbc..beed3a1e71 100644
--- a/mencoder.c
+++ b/mencoder.c
@@ -164,6 +164,7 @@ char *vobsub_out_id=NULL;
char* out_filename="test.avi";
char *force_fourcc=NULL;
+int force_audiofmttag=-1;
char* passtmpfile="divx2pass.log";
@@ -808,6 +809,15 @@ if(muxer->fix_stream_parameters)
// ============= AUDIO ===============
if(sh_audio){
+if (force_audiofmttag != -1) {
+ sh_audio->format = force_audiofmttag;
+ if (sh_audio->wf) {
+ sh_audio->wf->wFormatTag = sh_audio->format;
+ }
+ mp_msg(MSGT_MENCODER, MSGL_INFO, MSGTR_ForcingOutputAudiofmtTag,
+ force_audiofmttag);
+}
+
mux_a=muxer_new_stream(muxer,MUXER_TYPE_AUDIO);
mux_a->buffer_size=0x100000; //16384;
@@ -850,6 +860,10 @@ if(mux_a->codec != ACODEC_COPY) {
switch(mux_a->codec){
case ACODEC_COPY:
if (playback_speed != 1.0) mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_NoSpeedWithFrameCopy);
+ if (sh_audio->format >= 0x10000) {
+ mp_msg(MSGT_MENCODER,MSGL_ERR,MSGTR_CantCopyAudioFormat, sh_audio->format);
+ mencoder_exit(1,NULL);
+ }
if (sh_audio->wf){
mux_a->wf=malloc(sizeof(WAVEFORMATEX) + sh_audio->wf->cbSize);
memcpy(mux_a->wf, sh_audio->wf, sizeof(WAVEFORMATEX) + sh_audio->wf->cbSize);