[MPlayer-cvslog] r21252 - in trunk: libmpdemux/video.c sub_cc.c

reimar subversion at mplayerhq.hu
Sat Nov 25 23:06:00 CET 2006


Author: reimar
Date: Sat Nov 25 23:06:00 2006
New Revision: 21252

Modified:
   trunk/libmpdemux/video.c
   trunk/sub_cc.c

Log:
Cleanup for uselessly complicated closed-caption subtitle handling


Modified: trunk/libmpdemux/video.c
==============================================================================
--- trunk/libmpdemux/video.c	(original)
+++ trunk/libmpdemux/video.c	Sat Nov 25 23:06:00 2006
@@ -366,7 +366,7 @@
     /* if the user data starts with "CC", assume it is a CC info packet */
     if(len>2 && buf[0]=='C' && buf[1]=='C'){
 //    	mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"video.c: process_userdata() detected Closed Captions!\n");
-	if(subcc_enabled) subcc_process_data(buf+2,len-2);
+	subcc_process_data(buf+2,len-2);
     }
     if( len > 2 && buf[ 0 ] == 'T' && buf[ 1 ] == 'Y' )
     {

Modified: trunk/sub_cc.c
==============================================================================
--- trunk/sub_cc.c	(original)
+++ trunk/sub_cc.c	Sat Nov 25 23:06:00 2006
@@ -26,8 +26,6 @@
 #include "libvo/sub.h"
 
 
-#define CC_INPUTBUFFER_SIZE 256
-
 #define CC_MAX_LINE_LENGTH 64
 
 static char chartbl[128];
@@ -38,8 +36,6 @@
 static unsigned int cursor_pos=0;
 
 static int inited=0;
-static unsigned char inputbuffer[CC_INPUTBUFFER_SIZE];
-static unsigned int inputlength;
 
 static void build_char_table(void)
 {
@@ -186,7 +182,7 @@
   lastcode=data;  
 }
 
-static void subcc_decode(void)
+static void subcc_decode(unsigned char *inputbuffer, unsigned int inputlength)
 {
   /* The first number may denote a channel number. I don't have the
    * EIA-708 standard, so it is hard to say.
@@ -284,13 +280,9 @@
 
 void subcc_process_data(unsigned char *inputdata,unsigned int len)
 {
-	if (len > CC_INPUTBUFFER_SIZE)
-		return;
 	if(!subcc_enabled) return;
 	if(!inited) subcc_init();
 	
-	memcpy(inputbuffer,inputdata,len);
-	inputlength=len;
-	subcc_decode();
+	subcc_decode(inputdata, len);
 }
 



More information about the MPlayer-cvslog mailing list