diff mplayer.c @ 29263:0f1b5b68af32

whitespace cosmetics: Remove all trailing whitespace.
author diego
date Wed, 13 May 2009 02:58:57 +0000
parents a7bb794af98d
children 8b0f2c4971f4
line wrap: on
line diff
--- a/mplayer.c	Tue May 12 19:25:35 2009 +0000
+++ b/mplayer.c	Wed May 13 02:58:57 2009 +0000
@@ -251,8 +251,8 @@
 // codecs:
 char **audio_codec_list=NULL; // override audio codec
 char **video_codec_list=NULL; // override video codec
-char **audio_fm_list=NULL;    // override audio codec family 
-char **video_fm_list=NULL;    // override video codec family 
+char **audio_fm_list=NULL;    // override audio codec family
+char **video_fm_list=NULL;    // override video codec family
 
 // demuxer:
 extern char *demuxer_name; // override demuxer
@@ -472,7 +472,7 @@
   {
     return strdup (mp_basename2 (filename));
   }
-    
+
   case META_VIDEO_CODEC:
   {
     if (sh_video->format == 0x10000001)
@@ -495,14 +495,14 @@
     }
     return meta;
   }
-  
+
   case META_VIDEO_BITRATE:
   {
     meta = malloc (16);
     sprintf (meta, "%d kbps", (int) (sh_video->i_bps * 8 / 1024));
     return meta;
   }
-  
+
   case META_VIDEO_RESOLUTION:
   {
     meta = malloc (16);
@@ -516,14 +516,14 @@
       meta = strdup (sh_audio->codec->name);
     return meta;
   }
-  
+
   case META_AUDIO_BITRATE:
   {
     meta = malloc (16);
     sprintf (meta, "%d kbps", (int) (sh_audio->i_bps * 8/1000));
     return meta;
   }
-  
+
   case META_AUDIO_SAMPLES:
   {
     meta = malloc (16);
@@ -534,7 +534,7 @@
   /* check for valid demuxer */
   case META_INFO_TITLE:
     return get_demuxer_info ("Title");
-  
+
   case META_INFO_ARTIST:
     return get_demuxer_info ("Artist");
 
@@ -599,7 +599,7 @@
     vf_menu=NULL;
 #endif
   }
- 
+
   if(mask&INITIALIZED_DEMUXER){
     initialized_flags&=~INITIALIZED_DEMUXER;
     current_module="free_demuxer";
@@ -654,7 +654,7 @@
   if(mask&INITIALIZED_AO){
     initialized_flags&=~INITIALIZED_AO;
     current_module="uninit_ao";
-    if (mpctx->edl_muted) mixer_mute(&mpctx->mixer); 
+    if (mpctx->edl_muted) mixer_mute(&mpctx->mixer);
     mpctx->audio_out->uninit(mpctx->eof?0:1); mpctx->audio_out=NULL;
   }
 
@@ -681,7 +681,7 @@
 
 void exit_player_with_rc(exit_reason_t how, int rc){
 
-  if (mpctx->user_muted && !mpctx->edl_muted) mixer_mute(&mpctx->mixer); 
+  if (mpctx->user_muted && !mpctx->edl_muted) mixer_mute(&mpctx->mixer);
   uninit_player(INITIALIZED_ALL);
 #if defined(__MINGW32__) || defined(__CYGWIN__)
   timeEndPeriod(1);
@@ -712,7 +712,7 @@
 // free mplayer config
   if(mconfig)
     m_config_free(mconfig);
-  
+
   if(mpctx->playtree)
     play_tree_free(mpctx->playtree, 1);
 
@@ -744,7 +744,7 @@
 }
 
 #ifndef __MINGW32__
-static void child_sighandler(int x){  
+static void child_sighandler(int x){
   pid_t pid;
   while((pid=waitpid(-1,NULL,WNOHANG)) > 0);
 }
@@ -764,9 +764,9 @@
   if(initialized_flags==0 && sig_count>1) exit(1);
   if(sig_count==5)
     {
-      /* We're crashing bad and can't uninit cleanly :( 
-       * by popular request, we make one last (dirty) 
-       * effort to restore the user's 
+      /* We're crashing bad and can't uninit cleanly :(
+       * by popular request, we make one last (dirty)
+       * effort to restore the user's
        * terminal. */
       getch2_disable();
       exit(1);
@@ -813,14 +813,14 @@
           getch2_disable(); // allow terminal to work properly with gdb
           if (execlp("gdb", "gdb", prog_path, spid, "-ex", "bt", NULL) == -1)
             mp_msg(MSGT_CPLAYER, MSGL_ERR, "Couldn't start gdb\n");
-        } else if (gdb_pid < 0) 
+        } else if (gdb_pid < 0)
           mp_msg(MSGT_CPLAYER, MSGL_ERR, "Couldn't fork\n");
         else {
           waitpid(gdb_pid, NULL, 0);
         }
         if (x == SIGTRAP) return;
       }
-#endif  
+#endif
   }
   getch2_disable();
   exit(1);
@@ -869,7 +869,7 @@
     char *str;
     char protocol[strlen (PROFILE_CFG_PROTOCOL) + strlen (file) + 1];
     m_profile_t *p;
-    
+
     /* does filename actually uses a protocol ? */
     str = strstr (file, "://");
     if (!str)
@@ -933,7 +933,7 @@
     char *name;
 
     sprintf (cfg, "%s.conf", file);
-    
+
     if (use_filedir_conf && !stat (cfg, &st))
     {
 	mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LoadingConfig, cfg);
@@ -974,7 +974,7 @@
        } break;
        case MP_CMD_PLAY_TREE_UP_STEP: {
 	 eof = (cmd->args[0].v.i > 0) ? PT_UP_NEXT : PT_UP_PREV;
-       } break;	  
+       } break;
        case MP_CMD_PLAY_ALT_SRC_STEP: {
 	 eof = (cmd->args[0].v.i > 0) ?  PT_NEXT_SRC : PT_PREV_SRC;
        } break;
@@ -999,7 +999,7 @@
   } else
 #endif
   {
-  if(!entry) {      
+  if(!entry) {
     entry = mpctx->playtree_iter->tree;
     if(play_tree_iter_step(mpctx->playtree_iter,1,0) != PLAY_TREE_ITER_ENTRY) {
         return PT_NEXT_ENTRY;
@@ -1017,7 +1017,7 @@
   entry = mpctx->playtree_iter->tree;
   if(play_tree_iter_step(mpctx->playtree_iter,1,0) != PLAY_TREE_ITER_ENTRY) {
     return PT_NEXT_ENTRY;
-  }      
+  }
   play_tree_remove(entry,1,1);
   }
   return PT_NEXT_SRC;
@@ -1047,11 +1047,11 @@
 
     if (!asst && !subd)
 #else
-    if(!subd) 
+    if(!subd)
 #endif
         mp_msg(MSGT_CPLAYER, noerr ? MSGL_WARN : MSGL_ERR, MSGTR_CantLoadSub,
 		filename_recode(filename));
-    
+
 #ifdef CONFIG_ASS
     if (!asst && !subd) return;
     mpctx->set_of_ass_tracks[mpctx->set_of_sub_size] = asst;
@@ -1133,7 +1133,7 @@
 
 /*
  * In Mac OS X the SDL-lib is built upon Cocoa. The easiest way to
- * make it all work is to use the builtin SDL-bootstrap code, which 
+ * make it all work is to use the builtin SDL-bootstrap code, which
  * will be done automatically by replacing our main() if we include SDL.h.
  */
 #if defined(__APPLE__) && defined(CONFIG_SDL)
@@ -1206,7 +1206,7 @@
   width--;
 #endif
   line = malloc(width + 1); // one additional char for the terminating null
-  
+
   // Audio time
   if (mpctx->sh_audio) {
     saddf(line, &pos, width, "A:%6.1f ", a_pos);
@@ -1252,7 +1252,7 @@
   }
 
   // VO stats
-  if (sh_video) 
+  if (sh_video)
     saddf(line, &pos, width, "%d %d ", drop_frame_cnt, output_quality);
 
 #ifdef CONFIG_STREAM_CACHE
@@ -1336,17 +1336,17 @@
 
 /**
  *  \brief Add a message on the OSD message stack
- * 
+ *
  *  If a message with the same id is already present in the stack
  *  it is pulled on top of the stack, otherwise a new message is created.
- *  
+ *
  */
 
 void set_osd_msg(int id, int level, int time, const char* fmt, ...) {
     mp_osd_msg_t *msg,*last=NULL;
     va_list va;
     int r;
-   
+
     // look if the id is already in the stack
     for(msg = osd_msg_stack ; msg && msg->id != id ;
 	last = msg, msg = msg->prev);
@@ -1369,19 +1369,19 @@
     msg->id = id;
     msg->level = level;
     msg->time = time;
-    
+
 }
 
 /**
  *  \brief Remove a message from the OSD stack
- * 
+ *
  *  This function can be used to get rid of a message right away.
- * 
+ *
  */
 
 void rm_osd_msg(int id) {
     mp_osd_msg_t *msg,*last=NULL;
-    
+
     // Search for the msg
     for(msg = osd_msg_stack ; msg && msg->id != id ;
 	last = msg, msg = msg->prev);
@@ -1397,7 +1397,7 @@
 
 /**
  *  \brief Remove all messages from the OSD stack
- * 
+ *
  */
 
 static void clear_osd_msgs(void) {
@@ -1412,10 +1412,10 @@
 
 /**
  *  \brief Get the current message from the OSD stack.
- * 
+ *
  *  This function decrements the message timer and destroys the old ones.
  *  The message that should be displayed is returned (if any).
- *  
+ *
  */
 
 static mp_osd_msg_t* get_osd_msg(void) {
@@ -1439,9 +1439,9 @@
 
     if(!last_update) last_update = now;
     diff = now >= last_update ? now - last_update : 0;
-    
+
     last_update = now;
-    
+
     // Look for the first message in the stack with high enough level.
     for(msg = osd_msg_stack ; msg ; last = msg, msg = prev) {
         prev = msg->prev;
@@ -1478,9 +1478,9 @@
  */
 
 void set_osd_bar(int type,const char* name,double min,double max,double val) {
-    
+
     if(osd_level < 1) return;
-    
+
     if(mpctx->sh_video) {
         osd_visible = (GetTimerMS() + 1000) | 1;
         vo_osd_progbar_type = type;
@@ -1488,7 +1488,7 @@
         vo_osd_changed(OSDTYPE_PROGBAR);
         return;
     }
-    
+
     set_osd_msg(OSD_MSG_BAR,1,osd_duration,"%s: %d %%",
                 name,ROUND(100*(val-min)/(max-min)));
 }
@@ -1500,27 +1500,27 @@
  * This function displays the current message on the vo OSD or on the term.
  * If the stack is empty and the OSD level is high enough the timer
  * is displayed (only on the vo OSD).
- * 
+ *
  */
 
 static void update_osd_msg(void) {
     mp_osd_msg_t *msg;
     static char osd_text[128] = "";
     static char osd_text_timer[128];
-    
+
     // we need some mem for vo_osd_text
     vo_osd_text = (unsigned char*)osd_text;
-    
+
     // Look if we have a msg
     if((msg = get_osd_msg())) {
         if(strcmp(osd_text,msg->msg)) {
             strncpy((char*)osd_text, msg->msg, 127);
-            if(mpctx->sh_video) vo_osd_changed(OSDTYPE_OSD); else 
+            if(mpctx->sh_video) vo_osd_changed(OSDTYPE_OSD); else
             if(term_osd) mp_msg(MSGT_CPLAYER,MSGL_STATUS,"%s%s\n",term_osd_esc,msg->msg);
         }
         return;
     }
-        
+
     if(mpctx->sh_video) {
         // fallback on the timer
         if(osd_level>=2) {
@@ -1528,16 +1528,16 @@
             int percentage = -1;
             char percentage_text[10];
             int pts = demuxer_get_current_time(mpctx->demuxer);
-            
+
             if (mpctx->osd_show_percentage)
                 percentage = demuxer_get_percent_pos(mpctx->demuxer);
-            
+
             if (percentage >= 0)
                 snprintf(percentage_text, 9, " (%d%%)", percentage);
             else
                 percentage_text[0] = 0;
-            
-            if (osd_level == 3) 
+
+            if (osd_level == 3)
                 snprintf(osd_text_timer, 63,
                          "%c %02d:%02d:%02d / %02d:%02d:%02d%s",
                          mpctx->osd_function,pts/3600,(pts/60)%60,pts%60,
@@ -1548,18 +1548,18 @@
                          pts%60,percentage_text);
         } else
             osd_text_timer[0]=0;
-        
+
         // always decrement the percentage timer
         if(mpctx->osd_show_percentage)
             mpctx->osd_show_percentage--;
-        
+
         if(strcmp(osd_text,osd_text_timer)) {
             strncpy(osd_text, osd_text_timer, 63);
             vo_osd_changed(OSDTYPE_OSD);
         }
         return;
     }
-        
+
     // Clear the term osd line
     if(term_osd && osd_text[0]) {
         osd_text[0] = 0;
@@ -1599,7 +1599,7 @@
       mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_AudioFilterChainPreinitError);
       exit_player(EXIT_ERROR);
   }
-#endif  
+#endif
   current_module="ao2_init";
   if(!(mpctx->audio_out=init_best_audio_out(audio_driver_list,
       0, // plugin flag
@@ -1861,7 +1861,7 @@
     }
 
     if (ctx->d_sub) dvdsub_id = -2;
-        
+
     audio_delay = 0.0f;
 
     /// clear all EOF related flags
@@ -1900,7 +1900,7 @@
             mp_dvdnav_skip_wait(mpctx->stream);
         }
         mpctx->sh_video->pts += 1 / mpctx->sh_video->fps;
-    
+
         if (mpctx->nav_buffer) {
             *start = mpctx->nav_start;
             *in_size = mpctx->nav_in_size;
@@ -1919,7 +1919,7 @@
 {
     if (mpctx->stream->type != STREAMTYPE_DVDNAV)
         return;
-  
+
     if (mpctx->nav_buffer)
         free(mpctx->nav_buffer);
 
@@ -1989,10 +1989,10 @@
 	    if(!quiet)
 		print_status(a_pts - audio_delay, AV_delay, c_total);
 	}
-    
+
     } else {
 	// No audio:
-    
+
 	if (!quiet)
 	    print_status(0, 0, 0);
     }
@@ -2053,7 +2053,7 @@
 	if (!playsize)
 	    break;
 
-	// play audio:  
+	// play audio:
 	current_module="play_audio";
 
 	// Is this pts value actually useful for the aos that access it?
@@ -2420,7 +2420,7 @@
     if (!mpctx->sh_video) {
 	mp_msg(MSGT_CPLAYER, MSGL_ERR, MSGTR_EdlNOsh_video);
 	free_edl(edl_records);
-	next_edl_record = NULL; 
+	next_edl_record = NULL;
 	edl_records = NULL;
 	return;
     }
@@ -2472,7 +2472,7 @@
 	update_subtitles(mpctx->sh_video, mpctx->d_sub, 1);
 	update_teletext(mpctx->sh_video, mpctx->demuxer, 1);
     }
-      
+
     if (mpctx->sh_audio) {
 	current_module = "seek_audio_reset";
 	mpctx->audio_out->reset(); // stop audio, throwing away buffered data
@@ -2517,7 +2517,7 @@
 
   InitTimer();
   srand(GetTimerMS());
-  
+
   mp_msg_init();
 
   // Create the config context and register the options
@@ -2564,7 +2564,7 @@
     mpctx->playtree = play_tree_cleanup(mpctx->playtree);
     if(mpctx->playtree) {
       mpctx->playtree_iter = play_tree_iter_new(mpctx->playtree,mconfig);
-      if(mpctx->playtree_iter) {  
+      if(mpctx->playtree_iter) {
 	if(play_tree_iter_step(mpctx->playtree_iter,0,0) != PLAY_TREE_ITER_ENTRY) {
 	  play_tree_iter_free(mpctx->playtree_iter);
 	  mpctx->playtree_iter = NULL;
@@ -2573,7 +2573,7 @@
       }
     }
     }
-	
+
   print_version("MPlayer");
 
 #if (defined(__MINGW32__) || defined(__CYGWIN__)) && defined(CONFIG_GUI)
@@ -2596,7 +2596,7 @@
 	SetErrorMode(0x8003);
 	// request 1ms timer resolution
 	timeBeginPeriod(1);
-#endif	
+#endif
 
 #ifdef CONFIG_PRIORITY
     set_priority();
@@ -2619,13 +2619,13 @@
       // Free Playtree and Playtree-Iter as it's not used by the GUI.
       play_tree_iter_free(mpctx->playtree_iter);
       mpctx->playtree_iter=NULL;
-      
+
       if (getcwd(cwd, PATH_MAX) != (char *)NULL)
       {
 	  strcat(cwd, "/");
           // Prefix relative paths with current working directory
           play_tree_add_bpf(mpctx->playtree, cwd);
-      }      
+      }
       // Import initital playtree into GUI.
       import_initial_playtree_into_gui(mpctx->playtree, mconfig, enqueue);
     }
@@ -2843,7 +2843,7 @@
    }
  }
 #endif
-  
+
 initialized_flags|=INITIALIZED_INPUT;
 current_module = NULL;
 
@@ -2923,7 +2923,7 @@
       guiGetEvent( guiSetDefaults,0 );
       while ( guiIntfStruct.Playing != 1 )
        {
-        mp_cmd_t* cmd;                                                                                   
+        mp_cmd_t* cmd;
 	usec_sleep(20000);
 	guiEventHandling();
 	guiGetEvent( guiReDraw,NULL );
@@ -2931,7 +2931,7 @@
 	  guiGetEvent(guiIEvent, (char *)cmd->id);
 	  mp_cmd_free(cmd);
 	}
-       } 
+       }
       guiGetEvent( guiSetParameters,NULL );
       if ( guiIntfStruct.StreamType == STREAMTYPE_STREAM )
        {
@@ -2953,7 +2953,7 @@
 	    filename = play_tree_iter_get_file(mpctx->playtree_iter,1);
 	   }
          }
-       } 
+       }
     }
 #endif /* CONFIG_GUI */
 
@@ -3061,7 +3061,7 @@
           psub = realloc(psub,l);
           strcat(psub,bname);
           vo_vobsub=vobsub_open(psub,spudec_ifo,0,&vo_spudec);
-          free(psub);          
+          free(psub);
       }
       free(buf);
     }
@@ -3201,15 +3201,15 @@
 // HACK to get MOV Reference Files working
 
 if (mpctx->demuxer && mpctx->demuxer->type==DEMUXER_TYPE_PLAYLIST)
-{ 
+{
   unsigned char* playlist_entry;
   play_tree_t *list = NULL, *entry = NULL;
 
   current_module="handle_demux_playlist";
   while (ds_get_packet(mpctx->demuxer->video,&playlist_entry)>0)
-  {	 
+  {
     char *temp, *bname;
-    
+
     mp_msg(MSGT_CPLAYER,MSGL_V,"Adding file %s to element entry.\n",
 	    filename_recode(playlist_entry));
 
@@ -3221,7 +3221,7 @@
         continue;
 
     entry = play_tree_new();
-    
+
     if (filename && !strcmp(mp_basename(playlist_entry),playlist_entry)) // add reference path of current file
     {
       temp=malloc((strlen(filename)-strlen(mp_basename(filename))+strlen(playlist_entry)+1));
@@ -3237,7 +3237,7 @@
     }
     else
       play_tree_add_file(entry,playlist_entry);
-    
+
     if(!list)
       list = entry;
     else
@@ -3255,7 +3255,7 @@
   }
 }
 
-if(!mpctx->demuxer) 
+if(!mpctx->demuxer)
   goto goto_next_file;
 if(dvd_chapter>1) {
   float pts;
@@ -3314,7 +3314,7 @@
   case 2: ds=mpctx->d_video;break;
   case 3: ds=mpctx->d_sub;break;
   }
-  if(!ds){        
+  if(!ds){
       mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_DumpSelectedStreamMissing);
       exit_player(EXIT_ERROR);
   }
@@ -3386,11 +3386,11 @@
 			dir = DVB_CHANNEL_HIGHER;
 		else
 			dir = DVB_CHANNEL_LOWER;
-			
+
 		if(dvb_step_channel(mpctx->stream, dir))
 			mpctx->eof = mpctx->dvbin_reopen = 1;
 	}
-#endif	
+#endif
     goto goto_next_file; // exit_player(MSGTR_Exit_error);
 }
 
@@ -3409,9 +3409,9 @@
 // check .sub
   current_module="read_subtitles_file";
   if(sub_name){
-    for (i = 0; sub_name[i] != NULL; ++i) 
-        add_subtitles (sub_name[i], mpctx->sh_video->fps, 0); 
-  } 
+    for (i = 0; sub_name[i] != NULL; ++i)
+        add_subtitles (sub_name[i], mpctx->sh_video->fps, 0);
+  }
   if(sub_auto) { // auto load sub file ...
     char *psub = get_path( "sub/" );
     char **tmp = sub_filenames((psub ? psub : ""), filename);
@@ -3497,7 +3497,7 @@
       if (mpctx->demuxer->num_chapters == 0)
           stream_control(mpctx->demuxer->stream, STREAM_CTRL_GET_NUM_CHAPTERS, &mpctx->demuxer->num_chapters);
       mp_msg(MSGT_IDENTIFY,MSGL_INFO,"ID_CHAPTERS=%d\n", mpctx->demuxer->num_chapters);
-  } 
+  }
 
 if(!mpctx->sh_video) goto main; // audio-only
 
@@ -3524,7 +3524,7 @@
         mp_msg(MSGT_CPLAYER,MSGL_INFO,"%s",msg);
         free(msg);
     }
-        
+
 
 // Disable the term OSD in verbose mode
 if(verbose) term_osd = 0;
@@ -3704,7 +3704,7 @@
   }
 
 // ==========================================================================
-    
+
 //    current_module="draw_osd";
 //    if(vo_config_count) mpctx->video_out->draw_osd();
 
@@ -3796,7 +3796,7 @@
    }
  }
 #endif
- 
+
 //============================ Handle PAUSE ===============================
 
   current_module="pause";