[MPlayer-cvslog] r36727 - in trunk/sub: subreader.c subreader.h

reimar subversion at mplayerhq.hu
Sat Jan 25 17:54:57 CET 2014


Author: reimar
Date: Sat Jan 25 17:54:56 2014
New Revision: 36727

Log:
subreader: remove misleading return types.

Modified:
   trunk/sub/subreader.c
   trunk/sub/subreader.h

Modified: trunk/sub/subreader.c
==============================================================================
--- trunk/sub/subreader.c	Sat Jan 25 17:54:55 2014	(r36726)
+++ trunk/sub/subreader.c	Sat Jan 25 17:54:56 2014	(r36727)
@@ -1202,12 +1202,12 @@ void	subcp_close (void)
 	}
 }
 
-subtitle* subcp_recode (subtitle *sub)
+void subcp_recode (subtitle *sub)
 {
 	int l=sub->lines;
 	size_t ileft, oleft;
 	char *op, *ip, *ot;
-	if(icdsc == (iconv_t)(-1)) return sub;
+	if(icdsc == (iconv_t)(-1)) return;
 
 	while (l){
 		ip = sub->text[--l];
@@ -1234,7 +1234,7 @@ subtitle* subcp_recode (subtitle *sub)
 		free (sub->text[l]);
 		sub->text[l] = ot;
 	}
-	return sub;
+	return;
 }
 #endif
 
@@ -1261,7 +1261,7 @@ int do_fribid_log2vis(int charset, const
  * @param sub_utf8 whether the subtitle is encoded in UTF-8
  * @param from first new subtitle, all lines before this are assumed to be already converted
  */
-static subtitle* sub_fribidi (subtitle *sub, int av_unused sub_utf8, int av_unused from)
+static int sub_fribidi (subtitle *sub, int av_unused sub_utf8, int av_unused from)
 {
 #ifdef CONFIG_FRIBIDI
   FriBidiChar logical[LINE_LEN+1], visual[LINE_LEN+1]; // Hopefully these two won't smash the stack
@@ -1270,7 +1270,7 @@ static subtitle* sub_fribidi (subtitle *
   int l=sub->lines;
   int char_set_num;
   if (!flip_hebrew)
-    return sub;
+    return 1;
   fribidi_set_mirroring(1);
   fribidi_set_reorder_nsm(0);
 
@@ -1305,10 +1305,10 @@ static subtitle* sub_fribidi (subtitle *
       sub->text[l] = NULL;
     }
     sub->lines = 0;
-    return ERR;
+    return 0;
   }
 #endif
-  return sub;
+  return 1;
 }
 
 static void adjust_subs_time(subtitle* sub, float subtime, float fps, int block,
@@ -1526,10 +1526,9 @@ sub_data* sub_read_file (const char *fil
         sub=srp->read(fd,sub,utf16);
         if(!sub) break;   // EOF
 #ifdef CONFIG_ICONV
-	if ((sub!=ERR) && sub_utf8 == 2 && utf16 == 0) sub=subcp_recode(sub);
+	if ((sub!=ERR) && sub_utf8 == 2 && utf16 == 0) subcp_recode(sub);
 #endif
-	if (sub!=ERR) sub=sub_fribidi(sub,sub_utf8,0);
-	if ( sub == ERR )
+	if ( sub == ERR || !sub_fribidi(sub,sub_utf8,0))
 	 {
 #ifdef CONFIG_ICONV
           subcp_close();
@@ -2584,7 +2583,7 @@ void sub_add_text(subtitle *sub, const c
     free(sub->text[sub->lines]);
   }
   if (strip_markup)
-  sub = sub_fribidi(sub, sub_utf8, orig_lines);
+    sub_fribidi(sub, sub_utf8, orig_lines);
 }
 
 #define MP_NOPTS_VALUE (-1LL<<63)

Modified: trunk/sub/subreader.h
==============================================================================
--- trunk/sub/subreader.h	Sat Jan 25 17:54:55 2014	(r36726)
+++ trunk/sub/subreader.h	Sat Jan 25 17:54:56 2014	(r36727)
@@ -93,7 +93,7 @@ typedef void (*open_sub_func)(char *, fl
 typedef int (*open_vob_func)(const char *, const char * const, int, void *);
 
 sub_data* sub_read_file (const char *filename, float pts);
-subtitle* subcp_recode (subtitle *sub);
+void subcp_recode (subtitle *sub);
 // enca_fd is the file enca uses to determine the codepage.
 // setting to NULL disables enca.
 struct stream;


More information about the MPlayer-cvslog mailing list