mirror of
https://github.com/mpv-player/mpv
synced 2024-12-24 07:33:46 +01:00
avoid code duplication.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21780 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
d1c91ec012
commit
42552b211a
@ -30,7 +30,6 @@
|
|||||||
#include <mplayer.h>
|
#include <mplayer.h>
|
||||||
#include <mp_msg.h>
|
#include <mp_msg.h>
|
||||||
#include <help_mp.h>
|
#include <help_mp.h>
|
||||||
#include <cpudetect.h>
|
|
||||||
#include <input/input.h>
|
#include <input/input.h>
|
||||||
#include <input/mouse.h>
|
#include <input/mouse.h>
|
||||||
#include <osdep/keycodes.h>
|
#include <osdep/keycodes.h>
|
||||||
@ -51,12 +50,11 @@
|
|||||||
# define WM_XBUTTONDBLCLK 0x020D
|
# define WM_XBUTTONDBLCLK 0x020D
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define MP_TITLE "MPlayer " VERSION " (C) 2000-2006 MPlayer Team"
|
|
||||||
|
|
||||||
/* Globals / Externs */
|
/* Globals / Externs */
|
||||||
extern void renderinfobox(skin_t *skin, window_priv_t *priv);
|
extern void renderinfobox(skin_t *skin, window_priv_t *priv);
|
||||||
extern void renderwidget(skin_t *skin, image *dest, widget *item, int state);
|
extern void renderwidget(skin_t *skin, image *dest, widget *item, int state);
|
||||||
extern void mplayer_put_key(int code);
|
extern void mplayer_put_key(int code);
|
||||||
|
extern void print_version(void);
|
||||||
extern int WinID;
|
extern int WinID;
|
||||||
float sub_aspect;
|
float sub_aspect;
|
||||||
|
|
||||||
@ -105,38 +103,7 @@ void console_toggle(void)
|
|||||||
fp = freopen("con", "w", stdout);
|
fp = freopen("con", "w", stdout);
|
||||||
*stderr = *fp;
|
*stderr = *fp;
|
||||||
setvbuf(stderr, NULL, _IONBF, 0);
|
setvbuf(stderr, NULL, _IONBF, 0);
|
||||||
mp_msg(MSGT_CPLAYER, MSGL_INFO, "%s\n", MP_TITLE);
|
print_version();
|
||||||
GetCpuCaps(&gCpuCaps);
|
|
||||||
#ifdef 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);
|
|
||||||
#ifdef HAVE_MMX
|
|
||||||
mp_msg(MSGT_CPLAYER,MSGL_INFO," MMX");
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_MMX2
|
|
||||||
mp_msg(MSGT_CPLAYER,MSGL_INFO," MMX2");
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_3DNOW
|
|
||||||
mp_msg(MSGT_CPLAYER,MSGL_INFO," 3DNow");
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_3DNOWEX
|
|
||||||
mp_msg(MSGT_CPLAYER,MSGL_INFO," 3DNowEx");
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_SSE
|
|
||||||
mp_msg(MSGT_CPLAYER,MSGL_INFO," SSE");
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_SSE2
|
|
||||||
mp_msg(MSGT_CPLAYER,MSGL_INFO," SSE2");
|
|
||||||
#endif
|
|
||||||
mp_msg(MSGT_CPLAYER,MSGL_INFO,"\n\n");
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
console_state = 1;
|
console_state = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
57
mplayer.c
57
mplayer.c
@ -3514,34 +3514,10 @@ void pause_loop(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void print_version(void){
|
||||||
|
mp_msg(MSGT_CPLAYER, MSGL_INFO, "%s\n", MP_TITLE);
|
||||||
|
|
||||||
int main(int argc,char* argv[]){
|
/* Test for CPU capabilities (and corresponding OS support) for optimizing */
|
||||||
|
|
||||||
|
|
||||||
char * mem_ptr;
|
|
||||||
|
|
||||||
int file_format=DEMUXER_TYPE_UNKNOWN;
|
|
||||||
|
|
||||||
// movie info:
|
|
||||||
|
|
||||||
/* Flag indicating whether MPlayer should exit without playing anything. */
|
|
||||||
int opt_exit = 0;
|
|
||||||
|
|
||||||
//float a_frame=0; // Audio
|
|
||||||
|
|
||||||
int i;
|
|
||||||
char *tmp;
|
|
||||||
|
|
||||||
int gui_no_filename=0;
|
|
||||||
|
|
||||||
srand((int) time(NULL));
|
|
||||||
|
|
||||||
InitTimer();
|
|
||||||
|
|
||||||
mp_msg_init();
|
|
||||||
|
|
||||||
mp_msg(MSGT_CPLAYER,MSGL_INFO, "MPlayer " VERSION " (C) 2000-2006 MPlayer Team\n");
|
|
||||||
/* Test for CPU capabilities (and corresponding OS support) for optimizing */
|
|
||||||
GetCpuCaps(&gCpuCaps);
|
GetCpuCaps(&gCpuCaps);
|
||||||
#ifdef ARCH_X86
|
#ifdef ARCH_X86
|
||||||
mp_msg(MSGT_CPLAYER,MSGL_INFO,"CPUflags: MMX: %d MMX2: %d 3DNow: %d 3DNow2: %d SSE: %d SSE2: %d\n",
|
mp_msg(MSGT_CPLAYER,MSGL_INFO,"CPUflags: MMX: %d MMX2: %d 3DNow: %d 3DNow2: %d SSE: %d SSE2: %d\n",
|
||||||
@ -3573,7 +3549,34 @@ int gui_no_filename=0;
|
|||||||
mp_msg(MSGT_CPLAYER,MSGL_INFO,"\n");
|
mp_msg(MSGT_CPLAYER,MSGL_INFO,"\n");
|
||||||
#endif /* RUNTIME_CPUDETECT */
|
#endif /* RUNTIME_CPUDETECT */
|
||||||
#endif /* ARCH_X86 */
|
#endif /* ARCH_X86 */
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc,char* argv[]){
|
||||||
|
|
||||||
|
|
||||||
|
char * mem_ptr;
|
||||||
|
|
||||||
|
int file_format=DEMUXER_TYPE_UNKNOWN;
|
||||||
|
|
||||||
|
// movie info:
|
||||||
|
|
||||||
|
/* Flag indicating whether MPlayer should exit without playing anything. */
|
||||||
|
int opt_exit = 0;
|
||||||
|
|
||||||
|
//float a_frame=0; // Audio
|
||||||
|
|
||||||
|
int i;
|
||||||
|
char *tmp;
|
||||||
|
|
||||||
|
int gui_no_filename=0;
|
||||||
|
|
||||||
|
srand((int) time(NULL));
|
||||||
|
|
||||||
|
InitTimer();
|
||||||
|
|
||||||
|
mp_msg_init();
|
||||||
|
|
||||||
|
print_version();
|
||||||
#if defined(WIN32) && defined(USE_WIN32DLL)
|
#if defined(WIN32) && defined(USE_WIN32DLL)
|
||||||
set_path_env();
|
set_path_env();
|
||||||
#endif /*WIN32 && USE_WIN32DLL*/
|
#endif /*WIN32 && USE_WIN32DLL*/
|
||||||
|
@ -9,8 +9,10 @@ test $svn_revision || svn_revision=UNKNOWN
|
|||||||
|
|
||||||
NEW_REVISION="#define VERSION \"dev-SVN-r${svn_revision}${extra}\""
|
NEW_REVISION="#define VERSION \"dev-SVN-r${svn_revision}${extra}\""
|
||||||
OLD_REVISION=`cat version.h 2> /dev/null`
|
OLD_REVISION=`cat version.h 2> /dev/null`
|
||||||
|
TITLE="#define MP_TITLE \"MPlayer dev-SVN-r${svn_revision}${extra} (C) 2000-2006 MPlayer Team\""
|
||||||
|
|
||||||
# Update version.h only on revision changes to avoid spurious rebuilds
|
# Update version.h only on revision changes to avoid spurious rebuilds
|
||||||
if test "$NEW_REVISION" != "$OLD_REVISION"; then
|
if test "$NEW_REVISION" != "$OLD_REVISION"; then
|
||||||
echo "$NEW_REVISION" > version.h
|
echo "$NEW_REVISION" > version.h
|
||||||
|
echo "$TITLE" >> version.h
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user