From 7549813fbe9422de0d5632239d3d9fb5dd69df13 Mon Sep 17 00:00:00 2001 From: atmos4 Date: Thu, 25 Jul 2002 03:37:28 +0000 Subject: DVD Closed Captioning support, patch by Matteo Giani , small changes by me. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6785 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/video.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'libmpdemux/video.c') diff --git a/libmpdemux/video.c b/libmpdemux/video.c index 8c26809076..02121908d3 100644 --- a/libmpdemux/video.c +++ b/libmpdemux/video.c @@ -19,6 +19,9 @@ #include "parse_es.h" #include "mpeg_hdr.h" +/* sub_cc (closed captions)*/ +#include "../sub_cc.h" + /* biCompression constant */ #define BI_RGB 0L @@ -184,11 +187,19 @@ return 1; 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(subcc_enabled) subcc_process_data(buf+2,len-2); + } + if(verbose) + { printf( "user_data: len=%3d %02X %02X %02X %02X '", len, buf[0], buf[1], buf[2], buf[3]); for(i=0;i=32 && buf[i]<127) putchar(buf[i]); printf("'\n"); + } } int video_read_frame(sh_video_t* sh_video,float* frame_time_ptr,unsigned char** start,int force_fps){ @@ -234,7 +245,7 @@ int video_read_frame(sh_video_t* sh_video,float* frame_time_ptr,unsigned char** switch(i){ case 0x1B3: mp_header_process_sequence_header (&picture, &videobuffer[start]);break; case 0x1B5: mp_header_process_extension (&picture, &videobuffer[start]);break; - case 0x1B2: if(verbose) process_userdata (&videobuffer[start], videobuf_len-start);break; + case 0x1B2: process_userdata (&videobuffer[start], videobuf_len-start);break; } } -- cgit v1.2.3