OSDN Git Service

2007-01-14 Keishi Suenaga <skeishi@yahoo.co.jp>
authorKeishi Suenaga <s_keishi@mutt.freemail.ne.jp>
Sat, 13 Jan 2007 16:42:37 +0000 (16:42 +0000)
committerKeishi Suenaga <s_keishi@mutt.freemail.ne.jp>
Sat, 13 Jan 2007 16:42:37 +0000 (16:42 +0000)
    * timidity/flac_a.c
      timidity/gogo_a.c
      timidity/speex_a.c
      timidity/vorbis_a.c
      timidity/wave_a.c
      timidity/output_a.c: fix for autofilename

ChangeLog
timidity/flac_a.c
timidity/gogo_a.c
timidity/output.c
timidity/speex_a.c
timidity/vorbis_a.c
timidity/wave_a.c

index 7006856..8199c1c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-01-14  Keishi Suenaga <skeishi@yahoo.co.jp>
+
+    * timidity/flac_a.c
+      timidity/gogo_a.c
+      timidity/speex_a.c
+      timidity/vorbis_a.c
+      timidity/wave_a.c
+      timidity/output_a.c: fix for autofilename
+
 2007-01-13  Keishi Suenaga <skeishi@yahoo.co.jp>
 
     * timidity/wave_a.c: fix for server interface.
index ec3c7e8..5f4093b 100644 (file)
@@ -711,8 +711,6 @@ static int open_output(void)
 
 #ifndef __W32G__
   if(dpm.name == NULL) {
-    if (!current_file_info || !current_file_info->filename)
-      return -1;
     dpm.flag |= PF_AUTO_SPLIT_FILE;
   } else {
     dpm.flag &= ~PF_AUTO_SPLIT_FILE;
@@ -990,8 +988,11 @@ static int acntl(int request, void *arg)
 {
   switch(request) {
   case PM_REQ_PLAY_START:
-    if(dpm.flag & PF_AUTO_SPLIT_FILE)
+    if(dpm.flag & PF_AUTO_SPLIT_FILE){
+      if(  ( NULL == current_file_info ) || (NULL == current_file_info->filename ) )
+        return auto_flac_output_open("Output.mid",NULL);
       return auto_flac_output_open(current_file_info->filename, current_file_info->seq_name);
+   }
     return 0;
   case PM_REQ_PLAY_END:
     if(dpm.flag & PF_AUTO_SPLIT_FILE)
index 08a79e2..ea98bc6 100644 (file)
@@ -1258,8 +1258,6 @@ static int open_output(void)
 
 #if !defined ( IA_W32GUI ) && !defined ( IA_W32G_SYN )
     if(dpm.name == NULL) {
-      if (!current_file_info || !current_file_info->filename)
-        return -1;
       dpm.flag |= PF_AUTO_SPLIT_FILE;
     } else {
       dpm.flag &= ~PF_AUTO_SPLIT_FILE;
@@ -1348,10 +1346,13 @@ static void close_output(void)
 static int acntl(int request, void *arg)
 {
        switch(request) {
-       case PM_REQ_PLAY_START:
-               if(dpm.flag & PF_AUTO_SPLIT_FILE)
-                       return auto_gogo_output_open(current_file_info->filename,current_file_info->seq_name);
-               return 0;
+  case PM_REQ_PLAY_START:
+    if(dpm.flag & PF_AUTO_SPLIT_FILE){
+      if(  ( NULL == current_file_info ) || (NULL == current_file_info->filename ) )
+        return auto_gogo_output_open("Output.mid",NULL);
+      return auto_gogo_output_open(current_file_info->filename, current_file_info->seq_name);
+   }
+    return 0;
        case PM_REQ_PLAY_END:
                if(dpm.flag & PF_AUTO_SPLIT_FILE)
                        close_output();
index 474ac1d..3e1e7bb 100644 (file)
@@ -539,7 +539,7 @@ char *create_auto_output_name(const char *input_filename, char *ext_str, char *o
   int32 dir_len = 0;
   char ext_str_tmp[65];
 
-  output_filename = (char *)safe_malloc((output_dir?strlen(output_dir):0) + strlen(input_filename) + 6);
+  output_filename = (char *)safe_malloc((output_dir!=NULL?strlen(output_dir):0) + strlen(input_filename) + 6);
   if(output_filename==NULL)
     return NULL;
   output_filename[0] = '\0';
index d6038d0..1fea500 100644 (file)
@@ -435,8 +435,6 @@ static int open_output(void)
 
 #if !defined (IA_W32GUI) && !defined (IA_W32G_SYN)
   if (dpm.name == NULL) {
-    if (!current_file_info || !current_file_info->filename)
-      return -1;
     dpm.flag |= PF_AUTO_SPLIT_FILE;
   }
   else {
@@ -629,8 +627,11 @@ static int acntl(int request, void *arg)
 {
   switch(request) {
   case PM_REQ_PLAY_START:
-    if(dpm.flag & PF_AUTO_SPLIT_FILE)
-      return auto_speex_output_open(current_file_info->filename,current_file_info->seq_name);
+    if(dpm.flag & PF_AUTO_SPLIT_FILE){
+      if(  ( NULL == current_file_info ) || (NULL == current_file_info->filename ) )
+        return auto_speex_output_open("Output.mid",NULL);
+      return auto_speex_output_open(current_file_info->filename, current_file_info->seq_name);
+   }
     return 0;
   case PM_REQ_PLAY_END:
     if(dpm.flag & PF_AUTO_SPLIT_FILE)
index 7f9798e..90d5bf8 100644 (file)
@@ -415,8 +415,6 @@ static int open_output(void)
 
 #if !defined ( IA_W32GUI ) && !defined ( IA_W32G_SYN )
   if(dpm.name == NULL) {
-    if (!current_file_info || !current_file_info->filename)
-      return -1;
     dpm.flag |= PF_AUTO_SPLIT_FILE;
   } else {
     dpm.flag &= ~PF_AUTO_SPLIT_FILE;
@@ -553,8 +551,11 @@ static int acntl(int request, void *arg)
 {
   switch(request) {
   case PM_REQ_PLAY_START:
-    if(dpm.flag & PF_AUTO_SPLIT_FILE)
-      return auto_ogg_output_open(current_file_info->filename,current_file_info->seq_name);
+    if(dpm.flag & PF_AUTO_SPLIT_FILE){
+      if(  ( NULL == current_file_info ) || (NULL == current_file_info->filename ) )
+        return auto_ogg_output_open("Output.mid",NULL);
+      return auto_ogg_output_open(current_file_info->filename, current_file_info->seq_name);
+   }
     return 0;
   case PM_REQ_PLAY_END:
     if(dpm.flag & PF_AUTO_SPLIT_FILE)
index ff010a0..5b89cb3 100644 (file)
@@ -239,10 +239,7 @@ static int open_output(void)
 
 #ifndef __W32G__
     if(dpm.name == NULL) {
-         if ( (ctl->id_character == 'r') && (!current_file_info || !current_file_info->filename) )
-        return -1;
       dpm.flag |= PF_AUTO_SPLIT_FILE;
-      dpm.name = NULL;
     } else {
       dpm.flag &= ~PF_AUTO_SPLIT_FILE;
       if((dpm.fd = wav_output_open(dpm.name)) == -1)
@@ -341,8 +338,11 @@ static int acntl(int request, void *arg)
 {
   switch(request) {
   case PM_REQ_PLAY_START:
-    if(dpm.flag & PF_AUTO_SPLIT_FILE)
+    if(dpm.flag & PF_AUTO_SPLIT_FILE){
+      if(  ( NULL == current_file_info ) || (NULL == current_file_info->filename ) )
+        return auto_wav_output_open("Output.mid");
       return auto_wav_output_open(current_file_info->filename);
+   }
     return 0;
   case PM_REQ_PLAY_END:
     if(dpm.flag & PF_AUTO_SPLIT_FILE)