changeset 6791:a3b2f80f3a26

codmetics :)
author arpi
date Thu, 25 Jul 2002 16:39:22 +0000
parents 414f8c72f6e7
children 0d08931fb3c3
files libmpdemux/video.c sub_cc.c sub_cc.h
diffstat 3 files changed, 14 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/video.c	Thu Jul 25 15:32:29 2002 +0000
+++ b/libmpdemux/video.c	Thu Jul 25 16:39:22 2002 +0000
@@ -187,19 +187,18 @@
 
 static void process_userdata(unsigned char* buf,int len){
     int i;
-    if(!memcmp(buf,"CC",2)) /* if the user data starts with "CC", assume it is a CC info packet */
-    {
-    	if(verbose)printf("video.c: process_userdata() detected Closed Captions!\n");
+    /* 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);
     }
-    if(verbose)
-    {
+    if(!verbose) return;
     printf( "user_data: len=%3d  %02X %02X %02X %02X '",
 	    len, buf[0], buf[1], buf[2], buf[3]);
     for(i=0;i<len;i++)
-	if(buf[i]>=32 && buf[i]<127) putchar(buf[i]);
+//	if(buf[i]>=32 && buf[i]<127) putchar(buf[i]);
+	if(buf[i]&0x60) putchar(buf[i]&0x7F);
     printf("'\n");
-    }
 }
 
 int video_read_frame(sh_video_t* sh_video,float* frame_time_ptr,unsigned char** start,int force_fps){
--- a/sub_cc.c	Thu Jul 25 15:32:29 2002 +0000
+++ b/sub_cc.c	Thu Jul 25 16:39:22 2002 +0000
@@ -16,6 +16,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+#include "sub_cc.h"
+
 #include "subreader.h"
 
 #include "libvo/video_out.h"
@@ -28,10 +30,8 @@
 
 static char chartbl[128];
 
-extern int subcc_enabled;
-
-subtitle buf1,buf2;
-subtitle *fb,*bb;
+static subtitle buf1,buf2;
+static subtitle *fb,*bb;
 
 static unsigned int cursor_pos=0;
 
@@ -58,7 +58,7 @@
   chartbl[0x7f] = '¤';    /* FIXME: this should be a solid block */
 }
 
-void clear_buffer(subtitle *buf)
+static void clear_buffer(subtitle *buf)
 {
 	int i;
 	buf->lines=0;
@@ -184,7 +184,7 @@
   lastcode=data;  
 }
 
-void subcc_decode()
+static void subcc_decode()
 {
   /* The first number may denote a channel number. I don't have the
    * EIA-708 standard, so it is hard to say.
--- a/sub_cc.h	Thu Jul 25 15:32:29 2002 +0000
+++ b/sub_cc.h	Thu Jul 25 16:39:22 2002 +0000
@@ -2,6 +2,8 @@
 #define SUB_CC_H
 
 extern int subcc_enabled;
+
+void subcc_init();
 void subcc_process_data(unsigned char *inputdata,unsigned int len);
 
 #endif /*SUB_CC_H*/