[vlc-commits] packetizer: avparser: set proper frame flags
Francois Cartegnie
git at videolan.org
Tue Apr 6 18:18:43 UTC 2021
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Apr 6 18:21:05 2021 +0200| [0b94015abe92f2e2380bafe4232dc84c66585b9c] | committer: Francois Cartegnie
packetizer: avparser: set proper frame flags
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0b94015abe92f2e2380bafe4232dc84c66585b9c
---
modules/packetizer/avparser.c | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/modules/packetizer/avparser.c b/modules/packetizer/avparser.c
index 613e657993..f8a0b3d1bb 100644
--- a/modules/packetizer/avparser.c
+++ b/modules/packetizer/avparser.c
@@ -196,11 +196,29 @@ static block_t *Packetize ( decoder_t *p_dec, block_t **pp_block )
memcpy( p_ret->p_buffer, p_outdata, i_outlen );
p_ret->i_pts = p_block->i_pts;
p_ret->i_dts = p_block->i_dts;
+ p_block->i_pts = p_block->i_dts = VLC_TICK_INVALID;
+
+ if( p_dec->fmt_in.i_cat == VIDEO_ES )
+ {
+ switch ( p_sys->p_parser_ctx->pict_type )
+ {
+ case AV_PICTURE_TYPE_I:
+ p_ret->i_flags |= BLOCK_FLAG_TYPE_I;
+ break;
+ case AV_PICTURE_TYPE_P:
+ p_ret->i_flags |= BLOCK_FLAG_TYPE_P;
+ break;
+ case AV_PICTURE_TYPE_B:
+ p_ret->i_flags |= BLOCK_FLAG_TYPE_B;
+ break;
+ default:
+ break;
+ }
+ }
+
if( p_sys->p_parser_ctx->key_frame == 1 )
p_ret->i_flags |= BLOCK_FLAG_TYPE_I;
- p_block->i_pts = p_block->i_dts = VLC_TICK_INVALID;
-
return p_ret;
out:
More information about the vlc-commits
mailing list