[MPlayer-cvslog] r34849 - in trunk: libmpdemux/demux_lavf.c mpcommon.c sub/sub_cc.c sub/sub_cc.h
reimar
subversion at mplayerhq.hu
Sat Apr 7 22:08:53 CEST 2012
Author: reimar
Date: Sat Apr 7 22:08:53 2012
New Revision: 34849
Log:
Support EIA-608 captions in MOV.
Modified:
trunk/libmpdemux/demux_lavf.c
trunk/mpcommon.c
trunk/sub/sub_cc.c
trunk/sub/sub_cc.h
Modified: trunk/libmpdemux/demux_lavf.c
==============================================================================
--- trunk/libmpdemux/demux_lavf.c Sat Apr 7 21:37:11 2012 (r34848)
+++ trunk/libmpdemux/demux_lavf.c Sat Apr 7 22:08:53 2012 (r34849)
@@ -439,6 +439,12 @@ static void handle_stream(demuxer_t *dem
type = 'd';
else if(codec->codec_id == CODEC_ID_HDMV_PGS_SUBTITLE)
type = 'p';
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 14, 100)
+ else if(codec->codec_id == CODEC_ID_EIA_608)
+ type = 'c';
+#endif
+ else if(codec->codec_tag == MKTAG('c', '6', '0', '8'))
+ type = 'c';
else
break;
sh_sub = new_sh_sub_sid(demuxer, i, priv->sub_streams, lang ? lang->value : NULL);
Modified: trunk/mpcommon.c
==============================================================================
--- trunk/mpcommon.c Sat Apr 7 21:37:11 2012 (r34848)
+++ trunk/mpcommon.c Sat Apr 7 22:08:53 2012 (r34849)
@@ -46,6 +46,7 @@
#include "sub/ass_mp.h"
#include "sub/vobsub.h"
#include "sub/av_sub.h"
+#include "sub/sub_cc.h"
#include "libmpcodecs/dec_teletext.h"
#include "libavutil/intreadwrite.h"
#include "m_option.h"
@@ -181,6 +182,7 @@ void update_subtitles(sh_video_t *sh_vid
if (is_av_sub(type))
reset_avsub(d_dvdsub->sh);
#endif
+ subcc_reset();
}
// find sub
if (subdata) {
@@ -240,7 +242,7 @@ void update_subtitles(sh_video_t *sh_vid
if (vo_vobsub || timestamp >= 0)
spudec_assemble(vo_spudec, packet, len, timestamp);
}
- } else if (is_text_sub(type) || is_av_sub(type) || type == 'd') {
+ } else if (is_text_sub(type) || is_av_sub(type) || type == 'd' || type == 'c') {
int orig_type = type;
double endpts;
if (type == 'd' && !d_dvdsub->demuxer->teletext) {
@@ -287,6 +289,10 @@ void update_subtitles(sh_video_t *sh_vid
}
continue;
}
+ if (type == 'c') {
+ subcc_process_data(packet, len);
+ continue;
+ }
#ifdef CONFIG_ASS
if (ass_enabled) {
sh_sub_t* sh = d_dvdsub->sh;
Modified: trunk/sub/sub_cc.c
==============================================================================
--- trunk/sub/sub_cc.c Sat Apr 7 21:37:11 2012 (r34848)
+++ trunk/sub/sub_cc.c Sat Apr 7 22:08:53 2012 (r34849)
@@ -126,6 +126,13 @@ void subcc_init(void)
initialized=1;
}
+void subcc_reset(void)
+{
+ if (!initialized)
+ return;
+ clear_buffer(&buf1);
+ clear_buffer(&buf2);
+}
static void display_buffer(subtitle *buf)
{
Modified: trunk/sub/sub_cc.h
==============================================================================
--- trunk/sub/sub_cc.h Sat Apr 7 21:37:11 2012 (r34848)
+++ trunk/sub/sub_cc.h Sat Apr 7 22:08:53 2012 (r34849)
@@ -24,6 +24,7 @@
extern int subcc_enabled;
void subcc_init(void);
+void subcc_reset(void);
void subcc_process_data(const uint8_t *inputdata, unsigned int len);
void subcc_process_eia708(const uint8_t *data, int len);
More information about the MPlayer-cvslog
mailing list