[vlc-commits] demux: ogg: handle Flac in Ogg frame/packet pairing violation (fix #12706)

Francois Cartegnie git at videolan.org
Tue Nov 11 18:52:59 CET 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Nov 11 18:50:49 2014 +0100| [394c36356e1c59df350ccf287265e3eed4eaf07c] | committer: Francois Cartegnie

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

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=394c36356e1c59df350ccf287265e3eed4eaf07c
---

 modules/demux/ogg.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c
index 61102ec..b32054e 100644
--- a/modules/demux/ogg.c
+++ b/modules/demux/ogg.c
@@ -1353,6 +1353,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;
     }



More information about the vlc-commits mailing list