summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2008-12-04 01:55:52 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2008-12-04 01:55:52 +0200
commit8c144171bb80dd3d1f7161b97675e78cad00bc65 (patch)
tree7ad930ebc554ab68af1911f4dfd217cc18b86cce /mplayer.c
parent52ee93c1c64dfaa0afc881c38154b04c100cb617 (diff)
parent8c5889004f7ba9f6fcbca20a05a9301771348408 (diff)
downloadmpv-8c144171bb80dd3d1f7161b97675e78cad00bc65.tar.bz2
mpv-8c144171bb80dd3d1f7161b97675e78cad00bc65.tar.xz
Merge svn changes up to r28087
Conflicts: command.c libao2/ao_ivtv.c libao2/ao_v4l2.c libmpcodecs/dec_video.h libvo/aspect.h libvo/sub.c libvo/sub.h libvo/vo_directx.c libvo/vo_macosx.m libvo/vo_quartz.c mp_core.h mplayer.c mplayer.h osdep/getch2.h osdep/timer.h
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c65
1 files changed, 40 insertions, 25 deletions
diff --git a/mplayer.c b/mplayer.c
index d9eb28129d..caa96b143e 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -128,8 +128,8 @@ char *heartbeat_cmd;
#include "playtree.h"
#include "playtreeparser.h"
-extern int import_playtree_playlist_into_gui(play_tree_t* my_playtree, m_config_t* config);
-extern int import_initial_playtree_into_gui(play_tree_t* my_playtree, m_config_t* config, int enqueue);
+int import_playtree_playlist_into_gui(play_tree_t* my_playtree, m_config_t* config);
+int import_initial_playtree_into_gui(play_tree_t* my_playtree, m_config_t* config, int enqueue);
//**************************************************************************//
// Config
@@ -300,7 +300,7 @@ char* current_module=NULL; // for debugging
#ifdef CONFIG_MENU
#include "m_struct.h"
#include "libmenu/menu.h"
-extern void vf_menu_pause_update(struct vf_instance* vf);
+void vf_menu_pause_update(struct vf_instance* vf);
extern vf_info_t vf_info_menu;
static const vf_info_t* const libmenu_vfs[] = {
&vf_info_menu,
@@ -645,8 +645,8 @@ void uninit_player(struct MPContext *mpctx, unsigned int mask){
current_module=NULL;
}
-void exit_player_with_rc(struct MPContext *mpctx, const char* how, int rc){
-
+void exit_player_with_rc(struct MPContext *mpctx, exit_reason_t how, int rc)
+{
if (mpctx->user_muted && !mpctx->edl_muted) mixer_mute(&mpctx->mixer);
uninit_player(mpctx, INITIALIZED_ALL);
#if defined(__MINGW32__) || defined(__CYGWIN__)
@@ -692,13 +692,28 @@ void exit_player_with_rc(struct MPContext *mpctx, const char* how, int rc){
talloc_free(mpctx->key_fifo);
if(edl_records != NULL) free(edl_records); // free mem allocated for EDL
- if(how) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_ExitingHow,how);
+ switch(how) {
+ case EXIT_QUIT:
+ mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_ExitingHow,MSGTR_Exit_quit);
+ mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_EXIT=QUIT\n");
+ break;
+ case EXIT_EOF:
+ mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_ExitingHow,MSGTR_Exit_eof);
+ mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_EXIT=EOF\n");
+ break;
+ case EXIT_ERROR:
+ mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_ExitingHow,MSGTR_Exit_error);
+ mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_EXIT=ERROR\n");
+ break;
+ default:
+ mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_EXIT=NONE\n");
+ }
mp_msg(MSGT_CPLAYER,MSGL_DBG2,"max framesize was %d bytes\n",max_framesize);
exit(rc);
}
-static void exit_player(struct MPContext *mpctx, const char* how)
+static void exit_player(struct MPContext *mpctx, exit_reason_t how)
{
exit_player_with_rc(mpctx, how, 1);
}
@@ -798,7 +813,7 @@ char *conffile;
int conffile_fd;
if (!disable_system_conf &&
m_config_parse_config_file(conf, MPLAYER_CONFDIR "/mplayer.conf") < 0)
- exit_player(mpctx, NULL);
+ exit_player(mpctx, EXIT_NONE);
if ((conffile = get_path("")) == NULL) {
mp_msg(MSGT_CPLAYER,MSGL_WARN,MSGTR_NoHomeDir);
} else {
@@ -818,7 +833,7 @@ if ((conffile = get_path("")) == NULL) {
}
if (!disable_user_conf &&
m_config_parse_config_file(conf, conffile) < 0)
- exit_player(mpctx, NULL);
+ exit_player(mpctx, EXIT_NONE);
free(conffile);
}
}
@@ -930,7 +945,7 @@ static int libmpdemux_was_interrupted(struct MPContext *mpctx, int stop_play)
if((cmd = mp_input_get_cmd(mpctx->input, 0,0,0)) != NULL) {
switch(cmd->id) {
case MP_CMD_QUIT:
- exit_player_with_rc(mpctx, MSGTR_Exit_quit, (cmd->nargs > 0)? cmd->args[0].v.i : 0);
+ exit_player_with_rc(mpctx, EXIT_QUIT, (cmd->nargs > 0)? cmd->args[0].v.i : 0);
case MP_CMD_PLAY_TREE_STEP: {
stop_play = (cmd->args[0].v.i > 0) ? PT_NEXT_ENTRY : PT_PREV_ENTRY;
mpctx->play_tree_step = (cmd->args[0].v.i == 0) ? 1 : cmd->args[0].v.i;
@@ -1562,7 +1577,7 @@ if(mpctx->sh_audio){
// output:
&ao_data.samplerate, &ao_data.channels, &ao_data.format)){
mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_AudioFilterChainPreinitError);
- exit_player(mpctx, MSGTR_Exit_error);
+ exit_player(mpctx, EXIT_ERROR);
}
#endif
current_module="ao2_init";
@@ -2692,7 +2707,7 @@ if(!codecs_file || !parse_codec_cfg(codecs_file)){
if(!parse_codec_cfg(mem_ptr=get_path("codecs.conf"))){
if(!parse_codec_cfg(MPLAYER_CONFDIR "/codecs.conf")){
if(!parse_codec_cfg(NULL)){
- exit_player_with_rc(mpctx, NULL, 0);
+ exit_player_with_rc(mpctx, EXIT_NONE, 0);
}
mp_msg(MSGT_CPLAYER,MSGL_V,MSGTR_BuiltinCodecsConf);
}
@@ -2757,18 +2772,18 @@ if(!codecs_file || !parse_codec_cfg(codecs_file)){
}
if(opt_exit)
- exit_player(mpctx, NULL);
+ exit_player(mpctx, EXIT_NONE);
if (player_idle_mode && use_gui) {
mp_msg(MSGT_CPLAYER, MSGL_FATAL, MSGTR_NoIdleAndGui);
- exit_player_with_rc(mpctx, NULL, 1);
+ exit_player_with_rc(mpctx, EXIT_NONE, 1);
}
if(!mpctx->filename && !player_idle_mode){
if(!use_gui){
// no file/vcd/dvd -> show HELP:
mp_msg(MSGT_CPLAYER, MSGL_INFO, help_text);
- exit_player_with_rc(mpctx, NULL, 0);
+ exit_player_with_rc(mpctx, EXIT_NONE, 0);
} else gui_no_filename=1;
}
@@ -3022,7 +3037,7 @@ while (player_idle_mode && !mpctx->filename) {
entry = parse_playlist_file(mpctx->mconfig, cmd->args[0].v.s);
break;
case MP_CMD_QUIT:
- exit_player_with_rc(mpctx, MSGTR_Exit_quit, (cmd->nargs > 0)? cmd->args[0].v.i : 0);
+ exit_player_with_rc(mpctx, EXIT_QUIT, (cmd->nargs > 0)? cmd->args[0].v.i : 0);
break;
case MP_CMD_GET_PROPERTY:
case MP_CMD_SET_PROPERTY:
@@ -3173,14 +3188,14 @@ if(stream_dump_type==5){
current_module="dumpstream";
if(mpctx->stream->type==STREAMTYPE_STREAM && mpctx->stream->fd<0){
mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_DumpstreamFdUnavailable);
- exit_player(mpctx, MSGTR_Exit_error);
+ exit_player(mpctx, EXIT_ERROR);
}
stream_reset(mpctx->stream);
stream_seek(mpctx->stream,mpctx->stream->start_pos);
f=fopen(stream_dump_name,"wb");
if(!f){
mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_CantOpenDumpfile);
- exit_player(mpctx, MSGTR_Exit_error);
+ exit_player(mpctx, EXIT_ERROR);
}
if (dvd_chapter > 1) {
int chapter = dvd_chapter - 1;
@@ -3191,7 +3206,7 @@ if(stream_dump_type==5){
if(len>0) {
if(fwrite(buf,len,1,f) != 1) {
mp_msg(MSGT_MENCODER,MSGL_FATAL,MSGTR_ErrorWritingFile,stream_dump_name);
- exit_player(mpctx, MSGTR_Exit_error);
+ exit_player(mpctx, EXIT_ERROR);
}
}
if(dvd_last_chapter > 0) {
@@ -3203,10 +3218,10 @@ if(stream_dump_type==5){
}
if(fclose(f)) {
mp_msg(MSGT_MENCODER,MSGL_FATAL,MSGTR_ErrorWritingFile,stream_dump_name);
- exit_player(mpctx, MSGTR_Exit_error);
+ exit_player(mpctx, EXIT_ERROR);
}
mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_CoreDumped);
- exit_player_with_rc(mpctx, MSGTR_Exit_eof, 0);
+ exit_player_with_rc(mpctx, EXIT_EOF, 0);
}
#ifdef CONFIG_DVDREAD
@@ -3368,7 +3383,7 @@ if((stream_dump_type)&&(stream_dump_type<4)){
}
if(!ds){
mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_DumpSelectedStreamMissing);
- exit_player(mpctx, MSGTR_Exit_error);
+ exit_player(mpctx, EXIT_ERROR);
}
// disable other streams:
if(mpctx->d_audio && mpctx->d_audio!=ds) {ds_free_packs(mpctx->d_audio); mpctx->d_audio->id=-2; }
@@ -3378,7 +3393,7 @@ if((stream_dump_type)&&(stream_dump_type<4)){
f=fopen(stream_dump_name,"wb");
if(!f){
mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_CantOpenDumpfile);
- exit_player(mpctx, MSGTR_Exit_error);
+ exit_player(mpctx, EXIT_ERROR);
}
while(!ds->eof){
unsigned char* start;
@@ -3394,7 +3409,7 @@ if((stream_dump_type)&&(stream_dump_type<4)){
}
fclose(f);
mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_CoreDumped);
- exit_player_with_rc(mpctx, MSGTR_Exit_eof, 0);
+ exit_player_with_rc(mpctx, EXIT_EOF, 0);
}
mpctx->sh_audio=mpctx->d_audio->sh;
@@ -4061,7 +4076,7 @@ if(use_gui || mpctx->playtree_iter != NULL || player_idle_mode){
}
-exit_player_with_rc(mpctx, MSGTR_Exit_eof, 0);
+exit_player_with_rc(mpctx, EXIT_EOF, 0);
return 1;
}