From a42fd601efd1a9b76cf28cedf056972d8425f90d Mon Sep 17 00:00:00 2001 From: diego Date: Fri, 17 Sep 2004 02:28:44 +0000 Subject: Hardcoded EDL messages moved to help_mp-en.h, Doxygen comments added, patch by "Reynaldo H. Verdejo Pinochet" , spelling and wording corrections by me. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13359 b3059339-0415-0410-9bf9-f77b7e298cf2 --- edl.c | 43 +++++++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 14 deletions(-) (limited to 'edl.c') diff --git a/edl.c b/edl.c index 78360bf4f6..162de1e03c 100644 --- a/edl.c +++ b/edl.c @@ -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 @@ int edl_check_mode(void) 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 @@ int edl_count_entries(void) { 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 @@ int edl_count_entries(void) 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 @@ int edl_count_entries(void) 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 @@ int edl_parse_file(edl_record_ptr edl_records) 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 @@ int edl_parse_file(edl_record_ptr edl_records) 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; -- cgit v1.2.3