[MPlayer-dev-eng] [SURVEY] change mencoder's default ofilename extension?
Reynaldo H. Verdejo Pinochet
reynaldo at opendot.cl
Tue Dec 13 03:39:25 CET 2005
On Fri, Nov 25, 2005 at 08:43:02PM -0300, Reynaldo H. Verdejo Pinochet wrote:
> Default output filename of mencoder is always test.avi
> regardles of the muxer been used. Without trying to step
> on a 'extension are/arent meaningles' flame, think about
> windows user/progs that rely on filename extension to make
> 'open-with' asociations, icons disposal, etc. it may even
> be some apps that rely only on the extension for filetype
> identification.
>
Ok, hope everyone interested had time to react.
Option 5, propossed by Oded seems to be the winner* followed
close by '1' (force -o) attached is a slightly modified version
of the patch. Will commit tomorrow morning.
Best regards
Reynaldo
-------------- next part --------------
? cscope.out
Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.326
diff -a -u -r1.326 mencoder.c
--- mencoder.c 7 Dec 2005 10:07:27 -0000 1.326
+++ mencoder.c 13 Dec 2005 02:33:30 -0000
@@ -465,6 +465,26 @@
filelist = m_config_parse_me_command_line(mconfig, argc, argv);
if(!filelist) mencoder_exit(1, MSGTR_ErrorParsingCommandLine);
+{
+ int i, n = 0;
+ for (i = 0; out_filename[i]; i++)
+ if (out_filename[i] == '.') n = i + 1;
+ if (out_file_format == MUXER_TYPE_AVI) {
+ if (strcmp(out_filename + n, "avi") &&
+ strcmp(out_filename + n, "AVI"))
+ mp_msg(MSGT_MENCODER, MSGL_WARN, MSGTR_MencoderWrongFormatAVI);
+ }
+ if (out_file_format == MUXER_TYPE_MPEG) {
+ if (strcmp(out_filename + n, "mpg") &&
+ strcmp(out_filename + n, "mpeg") &&
+ strcmp(out_filename + n, "vob") &&
+ strcmp(out_filename + n, "MPG") &&
+ strcmp(out_filename + n, "MPEG") &&
+ strcmp(out_filename + n, "VOB"))
+ mp_msg(MSGT_MENCODER, MSGL_WARN, MSGTR_MencoderWrongFormatMPG);
+ }
+}
+
if (frameno_filename) {
stream2=open_stream(frameno_filename,0,&i);
if(stream2){
Index: help/help_mp-en.h
===================================================================
RCS file: /cvsroot/mplayer/main/help/help_mp-en.h,v
retrieving revision 1.211
diff -a -u -r1.211 help_mp-en.h
--- help/help_mp-en.h 13 Dec 2005 01:43:54 -0000 1.211
+++ help/help_mp-en.h 13 Dec 2005 02:33:36 -0000
@@ -238,6 +238,8 @@
#define MSGTR_NoVideoEncoderSelected "\nNo video encoder (-ovc) selected. Select one (see -ovc help).\n"
#define MSGTR_CannotOpenOutputFile "Cannot open output file '%s'.\n"
#define MSGTR_EncoderOpenFailed "Failed to open the encoder.\n"
+#define MSGTR_MencoderWrongFormatAVI "\nWARNING: OUTPUT FILE FORMAT IS _AVI_. see -of help.\n"
+#define MSGTR_MencoderWrongFormatMPG "\nWARNING: OUTPUT FILE FORMAT IS _MPEG_. see -of help.\n"
#define MSGTR_ForcingOutputFourcc "Forcing output fourcc to %x [%.4s]\n"
#define MSGTR_ForcingOutputAudiofmtTag "Forcing output audio format tag to 0x%x\n"
#define MSGTR_DuplicateFrames "\n%d duplicate frame(s)!\n"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20051212/3b82c8aa/attachment.pgp>
More information about the MPlayer-dev-eng
mailing list