1
mirror of https://github.com/mpv-player/mpv synced 2024-12-28 06:03:45 +01:00

Fix EDL to be per file, allow -edlout and -edl together as there is really

no reason not to.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17110 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
ods15 2005-12-06 08:52:18 +00:00
parent f95066fb03
commit 0fe5fb1e00
4 changed files with 16 additions and 41 deletions

18
edl.c
View File

@ -10,24 +10,6 @@ char *edl_output_filename; // file to put EDL entries in (-edlout)
#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.
*

3
edl.h
View File

@ -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 @@ typedef struct edl_record* edl_record_ptr;
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

View File

@ -187,7 +187,6 @@ static char help_text[]=
#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"

View File

@ -1526,26 +1526,6 @@ if(!codecs_file || !parse_codec_cfg(codecs_file)){
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 @@ while (player_idle_mode && !filename) {
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";