summaryrefslogtreecommitdiffstats
path: root/sub_cc.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-11-25 22:06:00 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-11-25 22:06:00 +0000
commit53ba4dd6eb4ee641e2ee15507c0c1e85e0ced9bd (patch)
tree9c33a1d90e224ad7906ee4cce859a9ee9325a1be /sub_cc.c
parent33d70768f997a4952d3f8eb14d64b5be71137249 (diff)
downloadmpv-53ba4dd6eb4ee641e2ee15507c0c1e85e0ced9bd.tar.bz2
mpv-53ba4dd6eb4ee641e2ee15507c0c1e85e0ced9bd.tar.xz
Cleanup for uselessly complicated closed-caption subtitle handling
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21252 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'sub_cc.c')
-rw-r--r--sub_cc.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/sub_cc.c b/sub_cc.c
index 28c4bdb2c3..d8b847541d 100644
--- a/sub_cc.c
+++ b/sub_cc.c
@@ -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 subtitle *fb,*bb;
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 @@ static void cc_decode_EIA608(unsigned short int data)
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 @@ static void subcc_decode(void)
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);
}