Commit 698a794d authored by Ben Hutchings's avatar Ben Hutchings Committed by Rémi Denis-Courmont
Browse files

live555: Discard truncated DV frames



The DV demuxer (rawdv) can't deal with truncated frames, so discard them.
Signed-off-by: Rémi Denis-Courmont's avatarRémi Denis-Courmont <remi@remlab.net>
parent fa134b7b
......@@ -154,6 +154,7 @@ typedef struct
bool b_muxed;
bool b_quicktime;
bool b_asf;
bool b_discard_trunc;
stream_t *p_out_muxed; /* for muxed stream */
uint8_t *p_buffer;
......@@ -784,6 +785,7 @@ static int SessionsSetup( demux_t *p_demux )
tk->b_quicktime = false;
tk->b_asf = false;
tk->b_muxed = false;
tk->b_discard_trunc = false;
tk->p_out_muxed = NULL;
tk->waiting = 0;
tk->b_rtcp_sync = false;
......@@ -1001,6 +1003,7 @@ static int SessionsSetup( demux_t *p_demux )
else if( !strcmp( sub->codecName(), "DV" ) )
{
tk->b_muxed = true;
tk->b_discard_trunc = true;
tk->p_out_muxed = stream_DemuxNew( p_demux, "rawdv",
p_demux->out );
}
......@@ -1618,7 +1621,9 @@ static void StreamRead( void *p_private, unsigned int i_size,
/* grow buffer if it looks like buffer is too small, but don't eat
* up all the memory on strange streams */
if( i_truncated_bytes > 0 && tk->i_buffer < 2000000 )
if( i_truncated_bytes > 0 )
{
if( tk->i_buffer < 2000000 )
{
void *p_tmp;
msg_Dbg( p_demux, "lost %d bytes", i_truncated_bytes );
......@@ -1635,6 +1640,14 @@ static void StreamRead( void *p_private, unsigned int i_size,
}
}
if( tk->b_discard_trunc )
{
p_sys->event = 0xff;
tk->waiting = 0;
return;
}
}
assert( i_size <= tk->i_buffer );
if( tk->fmt.i_codec == VLC_CODEC_AMR_NB ||
......
Supports Markdown
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