[vlc-commits] demux: ogg: force flac as non packetized
Francois Cartegnie
git at videolan.org
Thu Mar 15 22:59:00 CET 2018
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Mar 15 22:21:40 2018 +0100| [249c1e4138ee5dfe3c0e9482da145433c0d24325] | committer: Francois Cartegnie
demux: ogg: force flac as non packetized
can't properly handle restarts on radio streams
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=249c1e4138ee5dfe3c0e9482da145433c0d24325
---
modules/demux/ogg.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c
index b063a4de4e..4a58c26598 100644
--- a/modules/demux/ogg.c
+++ b/modules/demux/ogg.c
@@ -1470,18 +1470,7 @@ 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 );
- }
- else if( p_stream->fmt.i_codec == VLC_CODEC_TARKIN )
+ if( p_stream->fmt.i_codec == VLC_CODEC_TARKIN )
{
/* FIXME: the biggest hack I've ever done */
msg_Warn( p_demux, "tarkin pts: %"PRId64", granule: %"PRId64,
@@ -1713,6 +1702,7 @@ static int Ogg_FindLogicalStreams( demux_t *p_demux )
p_stream = NULL;
p_ogg->i_streams--;
}
+ p_stream->fmt.b_packetized = false;
}
/* Check for Theora header */
else if( oggpacket.bytes >= 7 &&
@@ -2484,6 +2474,8 @@ static bool Ogg_LogicalStreamResetEsFormat( demux_t *p_demux, logical_stream_t *
b_compatible = Ogg_IsVorbisFormatCompatible( &p_stream->fmt, &p_stream->fmt_old );
else if( p_stream->fmt.i_codec == VLC_CODEC_OPUS )
b_compatible = Ogg_IsOpusFormatCompatible( &p_stream->fmt, &p_stream->fmt_old );
+ else if( p_stream->fmt.i_codec == VLC_CODEC_FLAC )
+ b_compatible = !p_stream->fmt.b_packetized;
if( !b_compatible )
msg_Warn( p_demux, "cannot reuse old stream, resetting the decoder" );
More information about the vlc-commits
mailing list