summaryrefslogtreecommitdiffstats
path: root/libmpdemux/video.c
diff options
context:
space:
mode:
authoratmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-07-25 03:37:28 +0000
committeratmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-07-25 03:37:28 +0000
commit7549813fbe9422de0d5632239d3d9fb5dd69df13 (patch)
treeba945abcb51fe633fecd429f8fba12b2d69bd7c5 /libmpdemux/video.c
parente0d8d0061611045c7d44ba4dbe1fe333e7fea4a6 (diff)
downloadmpv-7549813fbe9422de0d5632239d3d9fb5dd69df13.tar.bz2
mpv-7549813fbe9422de0d5632239d3d9fb5dd69df13.tar.xz
DVD Closed Captioning support, patch by Matteo Giani <matgiani@ctonet.it>, small changes by me.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6785 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux/video.c')
-rw-r--r--libmpdemux/video.c13
1 files changed, 12 insertions, 1 deletions
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<len;i++)
if(buf[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;
}
}