[vlc-commits] packetizer: handle discontinuity without flush
Francois Cartegnie
git at videolan.org
Sat Jun 1 22:06:09 CEST 2019
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri May 10 17:42:29 2019 +0200| [c2cb744329c1143c1a1044966cfcdefa0bb2a87e] | committer: Francois Cartegnie
packetizer: handle discontinuity without flush
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c2cb744329c1143c1a1044966cfcdefa0bb2a87e
---
modules/packetizer/h264.c | 4 ++--
modules/packetizer/hevc.c | 11 ++++++-----
modules/packetizer/mjpeg.c | 4 ++--
modules/packetizer/mpeg4video.c | 4 ++--
modules/packetizer/mpegvideo.c | 4 ++--
modules/packetizer/packetizer_helper.h | 10 ++--------
modules/packetizer/vc1.c | 4 ++--
7 files changed, 18 insertions(+), 23 deletions(-)
diff --git a/modules/packetizer/h264.c b/modules/packetizer/h264.c
index 13806a1ba8..18e4ae871a 100644
--- a/modules/packetizer/h264.c
+++ b/modules/packetizer/h264.c
@@ -540,12 +540,12 @@ static void ResetOutputVariables( decoder_sys_t *p_sys )
p_sys->i_recovery_frame_cnt = UINT_MAX;
}
-static void PacketizeReset( void *p_private, bool b_broken )
+static void PacketizeReset( void *p_private, bool b_flush )
{
decoder_t *p_dec = p_private;
decoder_sys_t *p_sys = p_dec->p_sys;
- if( b_broken || !p_sys->b_slice )
+ if( b_flush || !p_sys->b_slice )
{
DropStoredNAL( p_sys );
ResetOutputVariables( p_sys );
diff --git a/modules/packetizer/hevc.c b/modules/packetizer/hevc.c
index 8cba9a66b7..f9b38fa8c6 100644
--- a/modules/packetizer/hevc.c
+++ b/modules/packetizer/hevc.c
@@ -348,10 +348,8 @@ static block_t *GetCc( decoder_t *p_dec, decoder_cc_desc_t *p_desc )
/****************************************************************************
* Packetizer Helpers
****************************************************************************/
-static void PacketizeReset(void *p_private, bool b_broken)
+static void PacketizeReset(void *p_private, bool b_flush)
{
- VLC_UNUSED(b_broken);
-
decoder_t *p_dec = p_private;
decoder_sys_t *p_sys = p_dec->p_sys;
@@ -359,8 +357,11 @@ static void PacketizeReset(void *p_private, bool b_broken)
if(p_out)
block_ChainRelease(p_out);
- p_sys->sets = MISSING;
- p_sys->b_recovery_point = false;
+ if(b_flush)
+ {
+ p_sys->sets = MISSING;
+ p_sys->b_recovery_point = false;
+ }
p_sys->b_need_ts = true;
date_Set(&p_sys->dts, VLC_TICK_INVALID);
}
diff --git a/modules/packetizer/mjpeg.c b/modules/packetizer/mjpeg.c
index 5f4e6ff8f3..223f7e9c7c 100644
--- a/modules/packetizer/mjpeg.c
+++ b/modules/packetizer/mjpeg.c
@@ -80,9 +80,9 @@ static void PacketizeFlush( decoder_t *p_dec )
/*****************************************************************************
* Helpers:
*****************************************************************************/
-static void PacketizeReset( void *p_private, bool b_broken )
+static void PacketizeReset( void *p_private, bool b_flush )
{
- VLC_UNUSED(b_broken);
+ VLC_UNUSED(b_flush);
decoder_t *p_dec = p_private;
decoder_sys_t *p_sys = p_dec->p_sys;
diff --git a/modules/packetizer/mpeg4video.c b/modules/packetizer/mpeg4video.c
index 4b67a8829c..927f71e828 100644
--- a/modules/packetizer/mpeg4video.c
+++ b/modules/packetizer/mpeg4video.c
@@ -204,12 +204,12 @@ static void PacketizeFlush( decoder_t *p_dec )
/*****************************************************************************
* Helpers:
*****************************************************************************/
-static void PacketizeReset( void *p_private, bool b_broken )
+static void PacketizeReset( void *p_private, bool b_flush )
{
decoder_t *p_dec = p_private;
decoder_sys_t *p_sys = p_dec->p_sys;
- if( b_broken )
+ if( b_flush )
{
if( p_sys->p_frame )
block_ChainRelease( p_sys->p_frame );
diff --git a/modules/packetizer/mpegvideo.c b/modules/packetizer/mpegvideo.c
index 158f5cfd06..ac8040f0d0 100644
--- a/modules/packetizer/mpegvideo.c
+++ b/modules/packetizer/mpegvideo.c
@@ -351,9 +351,9 @@ static block_t *GetCc( decoder_t *p_dec, decoder_cc_desc_t *p_desc )
/*****************************************************************************
* Helpers:
*****************************************************************************/
-static void PacketizeReset( void *p_private, bool b_broken )
+static void PacketizeReset( void *p_private, bool b_flush )
{
- VLC_UNUSED(b_broken);
+ VLC_UNUSED(b_flush);
decoder_t *p_dec = p_private;
decoder_sys_t *p_sys = p_dec->p_sys;
diff --git a/modules/packetizer/packetizer_helper.h b/modules/packetizer/packetizer_helper.h
index dece985b24..c65c4e5911 100644
--- a/modules/packetizer/packetizer_helper.h
+++ b/modules/packetizer/packetizer_helper.h
@@ -36,7 +36,7 @@ enum
STATE_CUSTOM_FIRST,
};
-typedef void (*packetizer_reset_t)( void *p_private, bool b_broken );
+typedef void (*packetizer_reset_t)( void *p_private, bool b_flush );
typedef block_t *(*packetizer_parse_t)( void *p_private, bool *pb_ts_used, block_t * );
typedef int (*packetizer_validate_t)( void *p_private, block_t * );
@@ -115,16 +115,10 @@ static inline block_t *packetizer_Packetize( packetizer_t *p_pack, block_t **pp_
if( p_drained )
return p_drained;
- const bool b_broken = !!( p_block->i_flags&BLOCK_FLAG_CORRUPTED );
p_pack->i_state = STATE_NOSYNC;
block_BytestreamEmpty( &p_pack->bytestream );
p_pack->i_offset = 0;
- p_pack->pf_reset( p_pack->p_private, b_broken );
- if( b_broken )
- {
- block_Release( p_block );
- return NULL;
- }
+ p_pack->pf_reset( p_pack->p_private, false );
}
if( p_block )
diff --git a/modules/packetizer/vc1.c b/modules/packetizer/vc1.c
index 2d4fdf13d2..e08ab034e8 100644
--- a/modules/packetizer/vc1.c
+++ b/modules/packetizer/vc1.c
@@ -272,12 +272,12 @@ static void Flush( decoder_t *p_dec )
packetizer_Flush( &p_sys->packetizer );
}
-static void PacketizeReset( void *p_private, bool b_broken )
+static void PacketizeReset( void *p_private, bool b_flush )
{
decoder_t *p_dec = p_private;
decoder_sys_t *p_sys = p_dec->p_sys;
- if( b_broken )
+ if( b_flush )
{
if( p_sys->p_frame )
block_ChainRelease( p_sys->p_frame );
More information about the vlc-commits
mailing list