Mercurial > mplayer.hg
diff edl.c @ 13358:567875b88aab
Hardcoded EDL messages moved to help_mp-en.h, Doxygen comments added, patch
by "Reynaldo H. Verdejo Pinochet" <reynaldo at opendot dot cl>, spelling
and wording corrections by me.
author | diego |
---|---|
date | Fri, 17 Sep 2004 02:28:44 +0000 |
parents | ce046ef860da |
children | 7a80c6ac5058 |
line wrap: on
line diff
--- a/edl.c Thu Sep 16 19:51:13 2004 +0000 +++ b/edl.c Fri Sep 17 02:28:44 2004 +0000 @@ -3,9 +3,18 @@ #include "config.h" #include "mp_msg.h" #include "edl.h" +#include "help_mp.h" #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) @@ -16,6 +25,13 @@ return (1); } +/** Calculates the total amount of edl_records we will need + * to hold the EDL operations queue, we need one edl_record + * for each SKIP and two for each MUTE. + * \return Number of necessary EDL entries, EDL_ERROR when file can't be read. + * \brief Counts needed EDL entries. + */ + int edl_count_entries(void) { FILE *fd = NULL; @@ -29,8 +45,7 @@ { if ((fd = fopen(edl_filename, "r")) == NULL) { - mp_msg(MSGT_CPLAYER, MSGL_WARN, - "Invalid EDL file, cant open '%s' for reading!\n", + mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_EdlCantOpenForRead, edl_filename); return (EDL_ERROR); } else @@ -46,8 +61,7 @@ entries += 2; } else { - mp_msg(MSGT_CPLAYER, MSGL_WARN, - "Invalid EDL line: %s\n", line); + mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_EdlNOValidLine, line); return (EDL_ERROR); } @@ -61,6 +75,11 @@ return (entries); } +/** Parses edl_filename to fill EDL operations queue. + * \return Number of stored EDL records or EDL_ERROR when file can't be read. + * \brief Fills EDL operations queue. + */ + int edl_parse_file(edl_record_ptr edl_records) { FILE *fd; @@ -84,9 +103,8 @@ if ((sscanf(line, "%f %f %d", &start, &stop, &action)) != 3) { - mp_msg(MSGT_CPLAYER, MSGL_WARN, - "Badly formated EDL line [%d]. Discarding!\n", - lineCount + 1, line); + mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_EdlBadlyFormattedLine, + lineCount + 1); continue; } else { @@ -95,21 +113,18 @@ if (start <= (next_edl_record - 1)->stop_sec) { mp_msg(MSGT_CPLAYER, MSGL_WARN, - "Invalid EDL line [%d]: %s", - lineCount, line); + MSGTR_EdlNOValidLine, line); mp_msg(MSGT_CPLAYER, MSGL_WARN, - "Last stop position was [%f]; next start is [%f]. Entries must be in chronological order and cannot overlap. Discarding!\n", + MSGTR_EdlBadLineOverlap, (next_edl_record - 1)->stop_sec, start); continue; } } if (stop <= start) { - mp_msg(MSGT_CPLAYER, MSGL_WARN, - "Invalid EDL line [%d]: %s", lineCount, + mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_EdlNOValidLine, line); - mp_msg(MSGT_CPLAYER, MSGL_WARN, - "Stop time must follow start time. Discarding!\n"); + mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_EdlBadLineBadStop); continue; } next_edl_record->action = action;