[MPlayer-cvslog] r28360 - in trunk: Makefile mencoder.c mpcommon.c mpcommon.h mplayer.c version.sh
diego
subversion at mplayerhq.hu
Sun Jan 25 21:35:59 CET 2009
Author: diego
Date: Sun Jan 25 21:35:58 2009
New Revision: 28360
Log:
Factorize print_version().
Modified:
trunk/Makefile
trunk/mencoder.c
trunk/mpcommon.c
trunk/mpcommon.h
trunk/mplayer.c
trunk/version.sh
Modified: trunk/Makefile
==============================================================================
--- trunk/Makefile Sun Jan 25 21:10:36 2009 (r28359)
+++ trunk/Makefile Sun Jan 25 21:35:58 2009 (r28360)
@@ -848,7 +848,7 @@ version.h:
###### dependency declarations / specific CFLAGS ######
codec-cfg.d: codecs.conf.h
-mencoder.d mplayer.d vobsub.d gui/win32/gui.d libmpdemux/muxer_avi.d osdep/mplayer-rc.o stream/network.d stream/stream_cddb.d: version.h
+mpcommon.d vobsub.d gui/win32/gui.d libmpdemux/muxer_avi.d osdep/mplayer-rc.o stream/network.d stream/stream_cddb.d: version.h
$(DEPS): help_mp.h
libdvdcss/%.o libdvdcss/%.d: CFLAGS += -D__USE_UNIX98 -D_GNU_SOURCE -DVERSION=\"1.2.9\" $(CFLAGS_LIBDVDCSS)
Modified: trunk/mencoder.c
==============================================================================
--- trunk/mencoder.c Sun Jan 25 21:10:36 2009 (r28359)
+++ trunk/mencoder.c Sun Jan 25 21:35:58 2009 (r28360)
@@ -36,13 +36,9 @@
#include <sys/time.h>
-
-#include "version.h"
#include "mp_msg.h"
#include "help_mp.h"
-#include "cpudetect.h"
-
#include "codec-cfg.h"
#include "m_option.h"
#include "m_config.h"
@@ -421,40 +417,7 @@ user_correct_pts = 0;
// Preparse the command line
m_config_preparse_command_line(mconfig,argc,argv);
- mp_msg(MSGT_CPLAYER,MSGL_INFO, "MEncoder " VERSION " (C) 2000-2009 MPlayer Team\n");
-
- /* Test for cpu capabilities (and corresponding OS support) for optimizing */
- GetCpuCaps(&gCpuCaps);
-#if ARCH_X86
- mp_msg(MSGT_CPLAYER,MSGL_INFO,"CPUflags: Type: %d MMX: %d MMX2: %d 3DNow: %d 3DNow2: %d SSE: %d SSE2: %d\n",
- gCpuCaps.cpuType,gCpuCaps.hasMMX,gCpuCaps.hasMMX2,
- gCpuCaps.has3DNow, gCpuCaps.has3DNowExt,
- gCpuCaps.hasSSE, gCpuCaps.hasSSE2);
-#ifdef RUNTIME_CPUDETECT
- mp_msg(MSGT_CPLAYER,MSGL_INFO, MSGTR_CompiledWithRuntimeDetection);
-#else
- mp_msg(MSGT_CPLAYER,MSGL_INFO, MSGTR_CompiledWithCPUExtensions);
-#if HAVE_MMX
- mp_msg(MSGT_CPLAYER,MSGL_INFO," MMX");
-#endif
-#if HAVE_MMX2
- mp_msg(MSGT_CPLAYER,MSGL_INFO," MMX2");
-#endif
-#if HAVE_3DNOW
- mp_msg(MSGT_CPLAYER,MSGL_INFO," 3DNow");
-#endif
-#if HAVE_3DNOWEX
- mp_msg(MSGT_CPLAYER,MSGL_INFO," 3DNowEx");
-#endif
-#if HAVE_SSE
- mp_msg(MSGT_CPLAYER,MSGL_INFO," SSE");
-#endif
-#if HAVE_SSE2
- mp_msg(MSGT_CPLAYER,MSGL_INFO," SSE2");
-#endif
- mp_msg(MSGT_CPLAYER,MSGL_INFO,"\n\n");
-#endif
-#endif
+ print_version("MEncoder");
#if (defined(__MINGW32__) || defined(__CYGWIN__)) && defined(CONFIG_WIN32DLL)
set_path_env();
Modified: trunk/mpcommon.c
==============================================================================
--- trunk/mpcommon.c Sun Jan 25 21:10:36 2009 (r28359)
+++ trunk/mpcommon.c Sun Jan 25 21:35:58 2009 (r28360)
@@ -5,7 +5,11 @@
#include "mplayer.h"
#include "libvo/sub.h"
#include "libvo/video_out.h"
+#include "cpudetect.h"
+#include "help_mp.h"
+#include "mp_msg.h"
#include "spudec.h"
+#include "version.h"
#include "vobsub.h"
#ifdef CONFIG_TV_TELETEXT
#include "stream/tv.h"
@@ -24,6 +28,47 @@ ass_track_t* ass_track = 0; // current t
sub_data* subdata = NULL;
subtitle* vo_sub_last = NULL;
+
+void print_version(const char* name)
+{
+ mp_msg(MSGT_CPLAYER, MSGL_INFO, MP_TITLE, name);
+
+ /* Test for CPU capabilities (and corresponding OS support) for optimizing */
+ GetCpuCaps(&gCpuCaps);
+#if ARCH_X86
+ mp_msg(MSGT_CPLAYER, MSGL_V,
+ "CPUflags: MMX: %d MMX2: %d 3DNow: %d 3DNow2: %d SSE: %d SSE2: %d\n",
+ gCpuCaps.hasMMX, gCpuCaps.hasMMX2,
+ gCpuCaps.has3DNow, gCpuCaps.has3DNowExt,
+ gCpuCaps.hasSSE, gCpuCaps.hasSSE2);
+#ifdef RUNTIME_CPUDETECT
+ mp_msg(MSGT_CPLAYER,MSGL_V, MSGTR_CompiledWithRuntimeDetection);
+#else
+ mp_msg(MSGT_CPLAYER,MSGL_V, MSGTR_CompiledWithCPUExtensions);
+#if HAVE_MMX
+ mp_msg(MSGT_CPLAYER,MSGL_V," MMX");
+#endif
+#if HAVE_MMX2
+ mp_msg(MSGT_CPLAYER,MSGL_V," MMX2");
+#endif
+#if HAVE_3DNOW
+ mp_msg(MSGT_CPLAYER,MSGL_V," 3DNow");
+#endif
+#if HAVE_3DNOWEX
+ mp_msg(MSGT_CPLAYER,MSGL_V," 3DNowEx");
+#endif
+#if HAVE_SSE
+ mp_msg(MSGT_CPLAYER,MSGL_V," SSE");
+#endif
+#if HAVE_SSE2
+ mp_msg(MSGT_CPLAYER,MSGL_V," SSE2");
+#endif
+ mp_msg(MSGT_CPLAYER,MSGL_V,"\n");
+#endif /* RUNTIME_CPUDETECT */
+#endif /* ARCH_X86 */
+}
+
+
void update_subtitles(sh_video_t *sh_video, demux_stream_t *d_dvdsub, int reset)
{
unsigned char *packet=NULL;
Modified: trunk/mpcommon.h
==============================================================================
--- trunk/mpcommon.h Sun Jan 25 21:10:36 2009 (r28359)
+++ trunk/mpcommon.h Sun Jan 25 21:35:58 2009 (r28360)
@@ -8,6 +8,8 @@
extern double sub_last_pts;
extern struct ass_track_s *ass_track;
extern subtitle *vo_sub_last;
+
+void print_version(const char* name);
void update_subtitles(sh_video_t *sh_video, demux_stream_t *d_dvdsub, int reset);
void update_teletext(sh_video_t *sh_video, demuxer_t *demuxer, int reset);
int select_audio(demuxer_t* demuxer, int audio_id, char* audio_lang);
Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c Sun Jan 25 21:10:36 2009 (r28359)
+++ trunk/mplayer.c Sun Jan 25 21:35:58 2009 (r28360)
@@ -36,8 +36,6 @@
#include <errno.h>
-#include "version.h"
-
#include "mp_msg.h"
#define HELP_MP_DEFINE_STATIC
@@ -74,8 +72,6 @@
#include "osdep/getch2.h"
#include "osdep/timer.h"
-#include "cpudetect.h"
-
#ifdef CONFIG_GUI
#include "gui/interface.h"
#endif
@@ -2396,43 +2392,6 @@ static void pause_loop(void)
#endif
}
-void print_version(void){
- mp_msg(MSGT_CPLAYER, MSGL_INFO, "%s\n", MP_TITLE);
-
-/* Test for CPU capabilities (and corresponding OS support) for optimizing */
- GetCpuCaps(&gCpuCaps);
-#if ARCH_X86
- mp_msg(MSGT_CPLAYER,MSGL_INFO,"CPUflags: MMX: %d MMX2: %d 3DNow: %d 3DNow2: %d SSE: %d SSE2: %d\n",
- gCpuCaps.hasMMX,gCpuCaps.hasMMX2,
- gCpuCaps.has3DNow, gCpuCaps.has3DNowExt,
- gCpuCaps.hasSSE, gCpuCaps.hasSSE2);
-#ifdef RUNTIME_CPUDETECT
- mp_msg(MSGT_CPLAYER,MSGL_INFO, MSGTR_CompiledWithRuntimeDetection);
-#else
- mp_msg(MSGT_CPLAYER,MSGL_INFO, MSGTR_CompiledWithCPUExtensions);
-#if HAVE_MMX
- mp_msg(MSGT_CPLAYER,MSGL_INFO," MMX");
-#endif
-#if HAVE_MMX2
- mp_msg(MSGT_CPLAYER,MSGL_INFO," MMX2");
-#endif
-#if HAVE_3DNOW
- mp_msg(MSGT_CPLAYER,MSGL_INFO," 3DNow");
-#endif
-#if HAVE_3DNOWEX
- mp_msg(MSGT_CPLAYER,MSGL_INFO," 3DNowEx");
-#endif
-#if HAVE_SSE
- mp_msg(MSGT_CPLAYER,MSGL_INFO," SSE");
-#endif
-#if HAVE_SSE2
- mp_msg(MSGT_CPLAYER,MSGL_INFO," SSE2");
-#endif
- mp_msg(MSGT_CPLAYER,MSGL_INFO,"\n");
-#endif /* RUNTIME_CPUDETECT */
-#endif /* ARCH_X86 */
-}
-
// Find the right mute status and record position for new file position
static void edl_seek_reset(MPContext *mpctx)
@@ -2570,7 +2529,7 @@ int gui_no_filename=0;
// Preparse the command line
m_config_preparse_command_line(mconfig,argc,argv);
- print_version();
+ print_version("MPlayer");
#if (defined(__MINGW32__) || defined(__CYGWIN__)) && defined(CONFIG_WIN32DLL)
set_path_env();
#endif
Modified: trunk/version.sh
==============================================================================
--- trunk/version.sh Sun Jan 25 21:10:36 2009 (r28359)
+++ trunk/version.sh Sun Jan 25 21:35:58 2009 (r28360)
@@ -9,7 +9,7 @@ test $svn_revision || svn_revision=UNKNO
NEW_REVISION="#define VERSION \"dev-SVN-r${svn_revision}${extra}\""
OLD_REVISION=`cat version.h 2> /dev/null`
-TITLE="#define MP_TITLE \"MPlayer dev-SVN-r${svn_revision}${extra} (C) 2000-2009 MPlayer Team\""
+TITLE="#define MP_TITLE \"%s dev-SVN-r${svn_revision}${extra} (C) 2000-2009 MPlayer Team\\\n\""
# Update version.h only on revision changes to avoid spurious rebuilds
if test "$NEW_REVISION" != "$OLD_REVISION"; then
More information about the MPlayer-cvslog
mailing list