[MPlayer-dev-eng] Re: [PATCH] edl now works when seeking, more

Reynaldo H. Verdejo Pinochet reynaldo at opendot.cl
Sat Sep 4 10:57:46 CEST 2004


On Sat, Sep 04, 2004 at 12:48:10AM -0400, Reynaldo H. Verdejo Pinochet wrote:
> > Other than that, you should add doxygen (doxygen.sf.net) style
> > comments to all functions and global variables.
> > I'll try to write some docu about this as soon as possible.
> Have readed it, will do.
> 
> I will send this changes with the big mencoder-with-edl patch, just
> giveme a few days
Hope this will do till i get mencoder's edl working

Best regards

   Reynaldo
   
-------------- next part --------------
--- edl.c	2004-08-27 20:46:05.000000000 -0400
+++ ../my_main/edl.c	2004-09-04 04:18:36.000000000 -0400
@@ -8,6 +8,12 @@
 
 int edl_check_mode(void)
 {
+/** Makes sure that edl has been called
+ * in one of his operating modes but not both
+ * we cant do -edl and -edlout at the same time
+ * so we return EDL_ERROR when this happens.
+ * 1 otherwise.
+ */
     if (edl_filename && edl_output_filename)
     {
         return (EDL_ERROR);
@@ -18,6 +24,10 @@
 
 int edl_count_entries(void)
 {
+/** Calculates the total amount edl_records we will need
+ * to hold the edl operations queue, we need one edl_record
+ * for each SKIP and two for each MUTE, returns total needed.
+ */
     FILE *fd = NULL;
     int entries = 0;
     int action = 0;
@@ -63,6 +73,11 @@
 
 int edl_parse_file(edl_record_ptr edl_records)
 {
+/** fills the edl operations queue,
+ * returns No of edl records stored, EDL_ERROR when
+ * cannot read from file.
+ */
+ 
     FILE *fd;
     char line[100];
     float start, stop;
@@ -109,7 +124,7 @@
                                "Invalid EDL line [%d]: %s", lineCount,
                                line);
                         mp_msg(MSGT_CPLAYER, MSGL_WARN,
-                               "Stop time must follow start time. Discarding!\n");
+                               "Stop time has to be after start time. Discarding!\n");
                         continue;
                     }
                     next_edl_record->action = action;
-------------- next part --------------
--- edl.h	2004-08-27 20:50:08.000000000 -0400
+++ ../my_main/edl.h	2004-09-04 04:19:41.000000000 -0400
@@ -23,11 +23,11 @@
 
 typedef struct edl_record* edl_record_ptr;
 
-char *edl_filename; // file to extract edl entries from (-edl)
-char *edl_output_filename; // file to put edl entries in (-edlout)
+char *edl_filename; /// file to extract edl entries from (-edl)
+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
-int edl_count_entries(void); // returns total No of entries needed
-int edl_parse_file(edl_record_ptr edl_records); // fills edl stack
+int edl_check_mode(void); /// we cannot do -edl and -edlout at the same time
+int edl_count_entries(void); /// returns total No of entries needed
+int edl_parse_file(edl_record_ptr edl_records); /// fills edl queue 
 
 #endif
-------------- next part --------------
--- mplayer.c	2004-09-02 18:40:17.000000000 -0400
+++ ../my_main/mplayer.c	2004-09-04 04:37:52.000000000 -0400
@@ -349,13 +349,13 @@
 #endif
 
 #ifdef USE_EDL
-edl_record_ptr edl_records = NULL; // EDL entries memory area
-edl_record_ptr next_edl_record = NULL; // only for traversing edl_records
-int edl_memory_slots = 0; // No of EDL entries (1 for skip + 2 for each mute)
-int edl_operations = 0; // No of EDL operations, skip + mute
-short edl_decision = 0; // 1 when an EDL operation has been made
-FILE* edl_fd = NULL; // fd to write to when in -edlout mode
-int edl_mute_count = 0; // even number when mute has been matched mute/unmute
+edl_record_ptr edl_records = NULL; /// EDL entries memory area
+edl_record_ptr next_edl_record = NULL; /// only for traversing edl_records
+int edl_memory_slots = 0; /// No of EDL entries (1 for skip + 2 for each mute)
+int edl_operations = 0; /// No of EDL operations, skip + mute
+short edl_decision = 0; /// 1 when an EDL operation has been made
+FILE* edl_fd = NULL; /// fd to write to when in -edlout mode
+int edl_mute_count = 0; /// even number when mute has been matched mute/unmute
 #endif
 
 static unsigned int inited_flags=0;
@@ -477,6 +477,9 @@
 
   current_module="exit_player";
 
+#ifdef USE_EDL
+  if(edl_records != NULL) free(edl_records); // free mem allocated for edl
+#endif
   if(how) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_ExitingHow,mp_gettext(how));
   mp_msg(MSGT_CPLAYER,MSGL_DBG2,"max framesize was %d bytes\n",max_framesize);
 
@@ -961,13 +964,9 @@
 #ifdef USE_EDL
 if (edl_check_mode() == EDL_ERROR && edl_filename)
 {
-    mp_msg(MSGT_CPLAYER, MSGL_WARN,
-           "Cant use -edl and -edlout at the same time\n");
-    mp_msg(MSGT_CPLAYER, MSGL_WARN, "Not using EDL at all!!!\n");
-    edl_filename = NULL;
-    edl_output_filename = NULL;
-    edl_records = NULL;
-    next_edl_record = edl_records;
+    mp_msg(MSGT_CPLAYER, MSGL_ERR,
+           "Cant use -edl and -edlout at the same time, exiting\n");
+    exit_player(NULL);
 } else if (edl_filename)
 {
     edl_memory_slots = edl_count_entries();
@@ -1000,11 +999,10 @@
 {
     if ((edl_fd = fopen(edl_output_filename, "w")) == NULL)
     {
-        mp_msg(MSGT_CPLAYER, MSGL_WARN, 
-	       "Error opening file [%s] for writing!\n",
+        mp_msg(MSGT_CPLAYER, MSGL_ERR, 
+	       "Error opening file [%s] for writing!, exiting\n",
                edl_output_filename);
-        edl_output_filename = NULL;
-        next_edl_record = edl_records;
+        exit_player(NULL);
     }
 }
 #endif
@@ -3506,7 +3504,7 @@
   }
 #ifdef USE_EDL
 /*
- * We Saw a seek, have to rewind the edl operations stak
+ * We saw a seek, have to rewind the edl operations stak
  * and find the next edl action to take care off
  */
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20040904/4714db8c/attachment.pgp>


More information about the MPlayer-dev-eng mailing list