Mercurial > mplayer.hg
comparison mencoder.c @ 15888:da752f91c5f2
Check for WAVEFORMAT.wFormatTag overflows and allow user to override the tag with -fafmttag
author | ranma |
---|---|
date | Sat, 02 Jul 2005 19:00:13 +0000 |
parents | 1d2b2c0d7e89 |
children | 7742302e793d |
comparison
equal
deleted
inserted
replaced
15887:a03d9116fc25 | 15888:da752f91c5f2 |
---|---|
162 char *vobsub_out_id=NULL; | 162 char *vobsub_out_id=NULL; |
163 | 163 |
164 char* out_filename="test.avi"; | 164 char* out_filename="test.avi"; |
165 | 165 |
166 char *force_fourcc=NULL; | 166 char *force_fourcc=NULL; |
167 int force_audiofmttag=-1; | |
167 | 168 |
168 char* passtmpfile="divx2pass.log"; | 169 char* passtmpfile="divx2pass.log"; |
169 | 170 |
170 static int play_n_frames=-1; | 171 static int play_n_frames=-1; |
171 static int play_n_frames_mf=-1; | 172 static int play_n_frames_mf=-1; |
806 //if(demuxer->file_format!=DEMUXER_TYPE_AVI) pts_from_bps=0; // it must be 0 for mpeg/asf! | 807 //if(demuxer->file_format!=DEMUXER_TYPE_AVI) pts_from_bps=0; // it must be 0 for mpeg/asf! |
807 | 808 |
808 // ============= AUDIO =============== | 809 // ============= AUDIO =============== |
809 if(sh_audio){ | 810 if(sh_audio){ |
810 | 811 |
812 if (force_audiofmttag != -1) { | |
813 sh_audio->format = force_audiofmttag; | |
814 if (sh_audio->wf) { | |
815 sh_audio->wf->wFormatTag = sh_audio->format; | |
816 } | |
817 mp_msg(MSGT_MENCODER, MSGL_INFO, MSGTR_ForcingOutputAudiofmtTag, | |
818 force_audiofmttag); | |
819 } | |
820 | |
811 mux_a=muxer_new_stream(muxer,MUXER_TYPE_AUDIO); | 821 mux_a=muxer_new_stream(muxer,MUXER_TYPE_AUDIO); |
812 | 822 |
813 mux_a->buffer_size=0x100000; //16384; | 823 mux_a->buffer_size=0x100000; //16384; |
814 mux_a->buffer=malloc(mux_a->buffer_size); | 824 mux_a->buffer=malloc(mux_a->buffer_size); |
815 if (!mux_a->buffer) | 825 if (!mux_a->buffer) |
848 } | 858 } |
849 } | 859 } |
850 switch(mux_a->codec){ | 860 switch(mux_a->codec){ |
851 case ACODEC_COPY: | 861 case ACODEC_COPY: |
852 if (playback_speed != 1.0) mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_NoSpeedWithFrameCopy); | 862 if (playback_speed != 1.0) mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_NoSpeedWithFrameCopy); |
863 if (sh_audio->format >= 0x10000) { | |
864 mp_msg(MSGT_MENCODER,MSGL_ERR,MSGTR_CantCopyAudioFormat, sh_audio->format); | |
865 mencoder_exit(1,NULL); | |
866 } | |
853 if (sh_audio->wf){ | 867 if (sh_audio->wf){ |
854 mux_a->wf=malloc(sizeof(WAVEFORMATEX) + sh_audio->wf->cbSize); | 868 mux_a->wf=malloc(sizeof(WAVEFORMATEX) + sh_audio->wf->cbSize); |
855 memcpy(mux_a->wf, sh_audio->wf, sizeof(WAVEFORMATEX) + sh_audio->wf->cbSize); | 869 memcpy(mux_a->wf, sh_audio->wf, sizeof(WAVEFORMATEX) + sh_audio->wf->cbSize); |
856 if(!sh_audio->i_bps) sh_audio->i_bps=mux_a->wf->nAvgBytesPerSec; | 870 if(!sh_audio->i_bps) sh_audio->i_bps=mux_a->wf->nAvgBytesPerSec; |
857 } else { | 871 } else { |