<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head></head><body><div style="font-size: 12pt; font-family: Calibri,sans-serif;"><div>CLOCK_FREQ is not a multiple of 30. Consider using date_t to avoid drift.</div><div><br></div><div>-- </div><div>Rémi Denis-Courmont</div><div>Sent from my NVIDIA Tegra-powered device</div><br><div id="htc_header">----- Reply message -----<br>De : git@videolan.org (Francois Cartegnie)<br>Pour : <vlc-commits@videolan.org><br>Objet : [vlc-commits] codec: cc: interpolate caption time by decoding speed<br>Date : jeu., août 13, 2015 15:19</div></div><br><pre style="word-wrap: break-word; white-space: pre-wrap;">vlc | branch: master | Francois Cartegnie <fcvlcdev@free.fr> | Sat Aug 8 00:26:50 2015 +0200| [3b60c9da2993432f36765d4fe24e88485f9c1e53] | committer: Francois Cartegnie
codec: cc: interpolate caption time by decoding speed
caption data rate is 2 bytes per frame at 30 fps
> <a href="http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3b60c9da2993432f36765d4fe24e88485f9c1e53">http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3b60c9da2993432f36765d4fe24e88485f9c1e53</a>
---
modules/codec/cc.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/modules/codec/cc.c b/modules/codec/cc.c
index 314e360..d8fa66e 100644
--- a/modules/codec/cc.c
+++ b/modules/codec/cc.c
@@ -166,6 +166,8 @@ struct decoder_sys_t
int i_field;
int i_channel;
+ mtime_t i_display_time;
+
eia608_t eia608;
bool b_opaque;
};
@@ -365,7 +367,10 @@ static subpicture_t *Convert( decoder_t *p_dec, block_t **pp_block )
block_t *p_block = *pp_block;
decoder_sys_t *p_sys = p_dec->p_sys;
- const int64_t i_pts = p_block->i_pts;
+
+ if( p_sys->i_display_time == VLC_TS_INVALID )
+ p_sys->i_display_time = p_block->i_pts;
+
eia608_status_t i_status = EIA608_STATUS_DEFAULT;
/* TODO do the real decoding here */
@@ -376,10 +381,15 @@ static subpicture_t *Convert( decoder_t *p_dec, block_t **pp_block )
p_block->i_buffer -= 3;
p_block->p_buffer += 3;
+ p_sys->i_display_time += CLOCK_FREQ / 30;
}
+
+ const mtime_t i_pts = p_sys->i_display_time;
+
if( p_block->i_buffer < 3 )
{
block_Release( p_block );
+ p_sys->i_display_time = VLC_TS_INVALID;
*pp_block = NULL;
}
_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
<a href="https://mailman.videolan.org/listinfo/vlc-commits">https://mailman.videolan.org/listinfo/vlc-commits</a>
</pre></body></html>