changeset 25264:42aa06653705

When auto loading subs, log warning instead of error for load failure.
author ulion
date Tue, 04 Dec 2007 12:34:44 +0000
parents 96d0992c7920
children 7055944e3ce9
files mp_core.h mplayer.c
diffstat 2 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mp_core.h	Tue Dec 04 10:42:59 2007 +0000
+++ b/mp_core.h	Tue Dec 04 12:34:44 2007 +0000
@@ -125,5 +125,5 @@
 			 ao_functions_t *audio_out);
 void exit_player_with_rc(const char* how, int rc);
 void rm_osd_msg(int id);
-void add_subtitles(char *filename, float fps, int silent);
+void add_subtitles(char *filename, float fps, int noerr);
 int reinit_video_chain(void);
--- a/mplayer.c	Tue Dec 04 10:42:59 2007 +0000
+++ b/mplayer.c	Tue Dec 04 12:34:44 2007 +0000
@@ -926,7 +926,7 @@
   return PT_NEXT_SRC;
 }
 
-void add_subtitles(char *filename, float fps, int silent)
+void add_subtitles(char *filename, float fps, int noerr)
 {
     sub_data *subd;
 #ifdef USE_ASS
@@ -948,11 +948,11 @@
     if (ass_enabled && subd && !asst)
         asst = ass_read_subdata(ass_library, subd, fps);
 
-    if (!asst && !subd && !silent)
+    if (!asst && !subd)
 #else
-    if(!subd && !silent) 
+    if(!subd) 
 #endif
-        mp_msg(MSGT_CPLAYER, MSGL_ERR, MSGTR_CantLoadSub,
+        mp_msg(MSGT_CPLAYER, noerr ? MSGL_WARN : MSGL_ERR, MSGTR_CantLoadSub,
 		filename_recode(filename));
     
 #ifdef USE_ASS
@@ -3158,7 +3158,7 @@
     int i = 0;
     free(psub); // release the buffer created by get_path() above
     while (tmp[i]) {
-        add_subtitles (tmp[i], mpctx->sh_video->fps, 0);
+        add_subtitles (tmp[i], mpctx->sh_video->fps, 1);
         free(tmp[i++]);
     }
     free(tmp);