[vlc-commits] access: dvdnav: flag cell change as discontinuity
Francois Cartegnie
git at videolan.org
Thu Apr 5 09:19:33 CEST 2018
vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Mar 26 20:17:02 2018 +0800| [ac19f73d9ba75bd08cffed5d1e4b85dafec825cb] | committer: Jean-Baptiste Kempf
access: dvdnav: flag cell change as discontinuity
Should close #20110
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit 10ebd491932a53d0b0f581b064c433c3f3375072)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=ac19f73d9ba75bd08cffed5d1e4b85dafec825cb
---
modules/access/dvdnav.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/modules/access/dvdnav.c b/modules/access/dvdnav.c
index 205401ed6b..36638d7680 100644
--- a/modules/access/dvdnav.c
+++ b/modules/access/dvdnav.c
@@ -115,6 +115,8 @@ vlc_module_end ()
#define DVD_READ_CACHE 1
#endif
+#define BLOCK_FLAG_CELL_DISCONTINUITY (BLOCK_FLAG_PRIVATE_SHIFT << 1)
+
/*****************************************************************************
* Local prototypes
*****************************************************************************/
@@ -1010,6 +1012,9 @@ static int Demux( demux_t *p_demux )
p_sys->i_vobu_index = 0;
p_sys->i_vobu_flush = 0;
+ for( int i=0; i<PS_TK_COUNT; i++ )
+ p_sys->tk[i].i_next_block_flags |= BLOCK_FLAG_CELL_DISCONTINUITY;
+
/* FIXME is it correct or there is better way to know chapter change */
if( dvdnav_current_title_info( p_sys->dvdnav, &i_title,
&i_part ) == DVDNAV_STATUS_OK )
@@ -1401,13 +1406,27 @@ static int DemuxBlock( demux_t *p_demux, const uint8_t *p, int len )
{
ESNew( p_demux, i_id );
}
+
if( tk->es &&
!ps_pkt_parse_pes( VLC_OBJECT(p_demux), p_pkt, tk->i_skip ) )
{
+ int i_next_block_flags = tk->i_next_block_flags;
+ tk->i_next_block_flags = 0;
+ if( i_next_block_flags & BLOCK_FLAG_CELL_DISCONTINUITY )
+ {
+ if( p_pkt->i_dts >= VLC_TS_INVALID )
+ {
+ i_next_block_flags &= ~BLOCK_FLAG_CELL_DISCONTINUITY;
+ i_next_block_flags |= BLOCK_FLAG_DISCONTINUITY;
+ }
+ else tk->i_next_block_flags = BLOCK_FLAG_CELL_DISCONTINUITY;
+ }
+ p_pkt->i_flags |= i_next_block_flags;
es_out_Send( p_demux->out, tk->es, p_pkt );
}
else
{
+ tk->i_next_block_flags = 0;
block_Release( p_pkt );
}
}
More information about the vlc-commits
mailing list