[MPlayer-dev-eng] help:Is it a bug or I make a mistake

Oded Shimon ods15 at ods15.dyndns.org
Tue Dec 6 08:12:52 CET 2005


On Tue, Dec 06, 2005 at 08:44:37AM +0200, Oded Shimon wrote:
> On Tue, Dec 06, 2005 at 02:57:41AM -0300, Reynaldo H. Verdejo Pinochet wrote:
> > On Tue, Dec 06, 2005 at 07:23:55AM +0200, Oded Shimon wrote:
> > > No, it is a bug.. One I meant to fix quite a while ago (when I FIRST messed 
> > > with the EDL code) and i'm surprised I still haven't fixed it.
> > > The bug - even though -edl is a per-file option, that code that handles it 
> > > in mplayer.c is in the global section.
> 
> Anyway, here's the patch.. Like I said, just a block move. I'll commit in a 
> bit.

Updated patch, few things fixed.

- ods15
-------------- next part --------------
Index: help/help_mp-en.h
===================================================================
RCS file: /cvsroot/mplayer/main/help/help_mp-en.h,v
retrieving revision 1.192
diff -u -r1.192 help_mp-en.h
--- help/help_mp-en.h	25 Oct 2005 18:47:20 -0000	1.192
+++ help/help_mp-en.h	6 Dec 2005 07:04:05 -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"
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.879
diff -u -r1.879 mplayer.c
--- mplayer.c	17 Oct 2005 18:16:28 -0000	1.879
+++ mplayer.c	6 Dec 2005 07:04:08 -0000
@@ -1278,26 +1278,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);
@@ -1582,6 +1562,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";
Index: edl.c
===================================================================
RCS file: /cvsroot/mplayer/main/edl.c,v
retrieving revision 1.4
diff -u -r1.4 edl.c
--- edl.c	25 Feb 2005 04:30:53 -0000	1.4
+++ edl.c	6 Dec 2005 07:04:08 -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.
Index: edl.h
===================================================================
RCS file: /cvsroot/mplayer/main/edl.h,v
retrieving revision 1.6
diff -u -r1.6 edl.h
--- edl.h	25 Feb 2005 04:30:53 -0000	1.6
+++ edl.h	6 Dec 2005 07:04:08 -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
 


More information about the MPlayer-dev-eng mailing list