Commit 7a7bb889 authored by Ilkka Ollakka's avatar Ilkka Ollakka

remove b_header in packetizer so sps/pps are send with every keyframe,

shouldn't break anything (tested on mp4/ts files, rtp stream and http/ts
stream). Files play correctly and MP4Box/ffmpeg recognize them
correctly. should fix #1384
parent 92875c21
...@@ -91,7 +91,6 @@ struct decoder_sys_t ...@@ -91,7 +91,6 @@ struct decoder_sys_t
vlc_bool_t b_sps; vlc_bool_t b_sps;
vlc_bool_t b_pps; vlc_bool_t b_pps;
vlc_bool_t b_header;
/* avcC data */ /* avcC data */
int i_avcC_length_size; int i_avcC_length_size;
...@@ -185,7 +184,6 @@ static int Open( vlc_object_t *p_this ) ...@@ -185,7 +184,6 @@ static int Open( vlc_object_t *p_this )
p_sys->b_pps = VLC_FALSE; p_sys->b_pps = VLC_FALSE;
p_sys->p_sps = 0; p_sys->p_sps = 0;
p_sys->p_pps = 0; p_sys->p_pps = 0;
p_sys->b_header= VLC_FALSE;
p_sys->slice.i_nal_type = -1; p_sys->slice.i_nal_type = -1;
p_sys->slice.i_nal_ref_idc = -1; p_sys->slice.i_nal_ref_idc = -1;
...@@ -251,7 +249,6 @@ static int Open( vlc_object_t *p_this ) ...@@ -251,7 +249,6 @@ static int Open( vlc_object_t *p_this )
p_dec->fmt_out.p_extra = (uint8_t*)malloc( p_dec->fmt_out.i_extra ); p_dec->fmt_out.p_extra = (uint8_t*)malloc( p_dec->fmt_out.i_extra );
memcpy( (uint8_t*)p_dec->fmt_out.p_extra, p_sys->p_sps->p_buffer, p_sys->p_sps->i_buffer); memcpy( (uint8_t*)p_dec->fmt_out.p_extra, p_sys->p_sps->p_buffer, p_sys->p_sps->i_buffer);
memcpy( (uint8_t*)p_dec->fmt_out.p_extra+p_sys->p_sps->i_buffer, p_sys->p_pps->p_buffer, p_sys->p_pps->i_buffer); memcpy( (uint8_t*)p_dec->fmt_out.p_extra+p_sys->p_sps->i_buffer, p_sys->p_pps->p_buffer, p_sys->p_pps->i_buffer);
p_sys->b_header = VLC_TRUE;
/* Set callback */ /* Set callback */
p_dec->pf_packetize = PacketizeAVC1; p_dec->pf_packetize = PacketizeAVC1;
...@@ -535,10 +532,7 @@ static block_t *ParseNALBlock( decoder_t *p_dec, block_t *p_frag ) ...@@ -535,10 +532,7 @@ static block_t *ParseNALBlock( decoder_t *p_dec, block_t *p_frag )
#define OUTPUT \ #define OUTPUT \
do { \ do { \
if( !p_sys->b_header && p_sys->slice.i_frame_type != BLOCK_FLAG_TYPE_I) \ if( p_sys->slice.i_frame_type == BLOCK_FLAG_TYPE_I && p_sys->p_sps && p_sys->p_pps ) \
break; \
\
if( p_sys->slice.i_frame_type == BLOCK_FLAG_TYPE_I && p_sys->p_sps && p_sys->p_pps && !p_sys->b_header ) \
{ \ { \
block_t *p_sps = block_Duplicate( p_sys->p_sps ); \ block_t *p_sps = block_Duplicate( p_sys->p_sps ); \
block_t *p_pps = block_Duplicate( p_sys->p_pps ); \ block_t *p_pps = block_Duplicate( p_sys->p_pps ); \
...@@ -546,7 +540,6 @@ static block_t *ParseNALBlock( decoder_t *p_dec, block_t *p_frag ) ...@@ -546,7 +540,6 @@ static block_t *ParseNALBlock( decoder_t *p_dec, block_t *p_frag )
p_sps->i_pts = p_sys->p_frame->i_pts; \ p_sps->i_pts = p_sys->p_frame->i_pts; \
block_ChainAppend( &p_sps, p_pps ); \ block_ChainAppend( &p_sps, p_pps ); \
block_ChainAppend( &p_sps, p_sys->p_frame ); \ block_ChainAppend( &p_sps, p_sys->p_frame ); \
p_sys->b_header = VLC_TRUE; \
p_pic = block_ChainGather( p_sps ); \ p_pic = block_ChainGather( p_sps ); \
} else { \ } else { \
p_pic = block_ChainGather( p_sys->p_frame ); \ p_pic = block_ChainGather( p_sys->p_frame ); \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment