changeset 16752:425863aab3df

fix mencoder multi-file with some files having audio but others dont
author ods15
date Thu, 13 Oct 2005 19:30:07 +0000
parents d9465442eef2
children 5f23a3beddfd
files help/help_mp-en.h mencoder.c
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/help/help_mp-en.h	Thu Oct 13 19:15:30 2005 +0000
+++ b/help/help_mp-en.h	Thu Oct 13 19:30:07 2005 +0000
@@ -218,6 +218,7 @@
 #define MSGTR_ResolutionDoesntMatch "\nNew video file has different resolution or colorspace than the previous one.\n"
 #define MSGTR_FrameCopyFileMismatch "\nAll video files must have identical fps, resolution, and codec for -ovc copy.\n"
 #define MSGTR_AudioCopyFileMismatch "\nAll files must have identical audio codec and format for -oac copy.\n"
+#define MSGTR_NoAudioFileMismatch "\nCan not mix video-only files with audio and video files. Try -nosound.\n"
 #define MSGTR_NoSpeedWithFrameCopy "WARNING: -speed is not guaranteed to work correctly with -oac copy!\n"\
 "Your encode might be broken!\n"
 #define MSGTR_ErrorWritingFile "%s: Error writing file.\n"
--- a/mencoder.c	Thu Oct 13 19:15:30 2005 +0000
+++ b/mencoder.c	Thu Oct 13 19:30:07 2005 +0000
@@ -948,7 +948,12 @@
 
 timer_start=GetTimerMS();
 } // if (!curfile) // if this was the first file.
-else if (sh_audio) {
+else {
+if (!mux_a != !sh_audio) {
+	mp_msg(MSGT_MENCODER,MSGL_FATAL,MSGTR_NoAudioFileMismatch);
+	mencoder_exit(1,NULL);
+}
+if (sh_audio) {
 	int out_format = 0, out_minsize = 0, out_maxsize = 0;
 	int do_init_filters = 1;
 	if((aencoder != NULL) && (mux_a->codec != ACODEC_COPY))
@@ -1011,6 +1016,7 @@
 	  mux_a->wf->nChannels = out_channels;
 	}
 }
+}
 
 parse_end_at();