summaryrefslogtreecommitdiffstats
path: root/mencoder.c
diff options
context:
space:
mode:
authorwanderer <wanderer@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-12-15 17:57:18 +0000
committerwanderer <wanderer@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-12-15 17:57:18 +0000
commit83e5f5e72a4dcae36e9ad099a9bd8f29cd3bdab6 (patch)
tree1954ab45058d6f31c767b578ef6b7fa1976f64a1 /mencoder.c
parentb0b4990d3f7b7e7afa738c08df6b1a3186ef0ef4 (diff)
downloadmpv-83e5f5e72a4dcae36e9ad099a9bd8f29cd3bdab6.tar.bz2
mpv-83e5f5e72a4dcae36e9ad099a9bd8f29cd3bdab6.tar.xz
make -o mandatory and add a warning when the extension does not match the container format, patch by Reynaldo Pinochet
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17197 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mencoder.c')
-rw-r--r--mencoder.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/mencoder.c b/mencoder.c
index 4e651dfbc9..cc9f9536b2 100644
--- a/mencoder.c
+++ b/mencoder.c
@@ -170,7 +170,7 @@ char *vobsub_out=NULL;
unsigned int vobsub_out_index=0;
char *vobsub_out_id=NULL;
-char* out_filename="test.avi";
+char* out_filename=NULL;
char *force_fourcc=NULL;
int force_audiofmttag=-1;
@@ -465,6 +465,33 @@ if(!codecs_file || !parse_codec_cfg(codecs_file)){
filelist = m_config_parse_me_command_line(mconfig, argc, argv);
if(!filelist) mencoder_exit(1, MSGTR_ErrorParsingCommandLine);
+{
+ char *extension;
+
+ if (!out_filename) mencoder_exit(1,MSGTR_MissingOutputFilename);
+ extension=strrchr(out_filename,'.');
+ if (extension != NULL && strlen(extension) > 3 && strlen(extension) < 6)
+ {
+ extension++;
+
+ switch (out_file_format)
+ {
+ case MUXER_TYPE_AVI:
+ if (strcasecmp(extension,"avi"))
+ mp_msg(MSGT_MENCODER, MSGL_WARN, MSGTR_MencoderWrongFormatAVI);
+ break;
+
+ case MUXER_TYPE_MPEG:
+ if (strcasecmp(extension,"mpg") &&
+ strcasecmp(extension,"mpeg") &&
+ strcasecmp(extension,"vob"))
+ mp_msg(MSGT_MENCODER, MSGL_WARN, MSGTR_MencoderWrongFormatMPG);
+ break;
+ }
+ }
+}
+
+
if (frameno_filename) {
stream2=open_stream(frameno_filename,0,&i);
if(stream2){