# HG changeset patch # User ods15 # Date 1133859138 0 # Node ID 327be31a101ddb38e0c1b711f751db2c6dd3b609 # Parent f9a03e3c8e23c1be2934060927ad7532879e4743 Fix EDL to be per file, allow -edlout and -edl together as there is really no reason not to. diff -r f9a03e3c8e23 -r 327be31a101d edl.c --- a/edl.c Tue Dec 06 08:47:32 2005 +0000 +++ b/edl.c Tue Dec 06 08:52:18 2005 +0000 @@ -11,24 +11,6 @@ #ifdef USE_EDL /** - * We can't do -edl and -edlout at the same time - * so we check that here. - * - * \return EDL_ERROR on error and 1 otherwise. - * \brief Makes sure EDL has been called correctly. - */ - -int edl_check_mode(void) -{ - if (edl_filename && edl_output_filename) - { - return (EDL_ERROR); - } - - return (1); -} - -/** * Allocates a new EDL record and makes sure allocation was successful. * * \return New allocated EDL record. diff -r f9a03e3c8e23 -r 327be31a101d edl.h --- a/edl.h Tue Dec 06 08:47:32 2005 +0000 +++ b/edl.h Tue Dec 06 08:52:18 2005 +0000 @@ -5,7 +5,7 @@ #define EDL_SKIP 0 #define EDL_MUTE 1 -#define EDL_ERROR -1 + #define EDL_MUTE_START 1 #define EDL_MUTE_END 0 @@ -23,7 +23,6 @@ extern char *edl_filename; // file to extract EDL entries from (-edl) extern char *edl_output_filename; // file to put EDL entries in (-edlout) -int edl_check_mode(void); // we cannot do -edl and -edlout at the same time void free_edl(edl_record_ptr next_edl_record); // free's entire EDL list. edl_record_ptr edl_parse_file(); // fills EDL stack diff -r f9a03e3c8e23 -r 327be31a101d help/help_mp-en.h --- a/help/help_mp-en.h Tue Dec 06 08:47:32 2005 +0000 +++ b/help/help_mp-en.h Tue Dec 06 08:52:18 2005 +0000 @@ -187,7 +187,6 @@ #define MSGTR_DvdnavNavSeekDone "DVDNAV Event: Nav Seek Done\n" #define MSGTR_MenuCall "Menu call\n" -#define MSGTR_EdlCantUseBothModes "Can't use -edl and -edlout at the same time.\n" #define MSGTR_EdlOutOfMem "Can't allocate enough memory to hold EDL data.\n" #define MSGTR_EdlRecordsNo "Read %d EDL actions.\n" #define MSGTR_EdlQueueEmpty "There are no EDL actions to take care of.\n" diff -r f9a03e3c8e23 -r 327be31a101d mplayer.c --- a/mplayer.c Tue Dec 06 08:47:32 2005 +0000 +++ b/mplayer.c Tue Dec 06 08:52:18 2005 +0000 @@ -1526,26 +1526,6 @@ if(opt_exit) exit_player(NULL); -#ifdef USE_EDL -if (edl_check_mode() == EDL_ERROR && edl_filename) -{ - mp_msg(MSGT_CPLAYER, MSGL_ERR, MSGTR_EdlCantUseBothModes); - exit_player(NULL); -} else if (edl_filename) -{ - if (edl_records) free_edl(edl_records); - next_edl_record = edl_records = edl_parse_file(); -} else if (edl_output_filename) -{ - if ((edl_fd = fopen(edl_output_filename, "w")) == NULL) - { - mp_msg(MSGT_CPLAYER, MSGL_ERR, MSGTR_EdlCantOpenForWrite, - edl_output_filename); - exit_player(NULL); - } -} -#endif - if (player_idle_mode && use_gui) { mp_msg(MSGT_CPLAYER, MSGL_FATAL, MSGTR_NoIdleAndGui); exit_player_with_rc(NULL, 1); @@ -1828,6 +1808,21 @@ if(filename) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_Playing, filename); +#ifdef USE_EDL +if (edl_filename) { + if (edl_records) free_edl(edl_records); + next_edl_record = edl_records = edl_parse_file(); +} +if (edl_output_filename) { + if (edl_fd) fclose(edl_fd); + if ((edl_fd = fopen(edl_output_filename, "w")) == NULL) + { + mp_msg(MSGT_CPLAYER, MSGL_ERR, MSGTR_EdlCantOpenForWrite, + edl_output_filename); + } +} +#endif + //==================== Open VOB-Sub ============================ current_module="vobsub";