Commit 81457d29 authored by Francois Cartegnie's avatar Francois Cartegnie Committed by Jean-Baptiste Kempf

demux: ogg: handle Flac in Ogg frame/packet pairing violation (fix #12706)

(cherry picked from commit 394c36356e1c59df350ccf287265e3eed4eaf07c)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 416d829b
......@@ -1340,6 +1340,18 @@ static void Ogg_DecodePacket( demux_t *p_demux,
}
else if( p_stream->fmt.i_cat == AUDIO_ES )
{
if ( p_stream->fmt.i_codec == VLC_CODEC_FLAC &&
p_stream->p_es && 0 >= p_oggpacket->granulepos &&
p_stream->fmt.b_packetized )
{
/* Handle OggFlac spec violation (multiple frame/packet
* by turning on packetizer */
msg_Warn( p_demux, "Invalid FLAC in ogg detected. Restarting ES with packetizer." );
p_stream->fmt.b_packetized = false;
es_out_Del( p_demux->out, p_stream->p_es );
p_stream->p_es = es_out_Add( p_demux->out, &p_stream->fmt );
}
/* Blatant abuse of the i_length field. */
p_block->i_length = p_stream->i_end_trim;
}
......
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