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

Francois Cartegnie git at videolan.org
Mon Nov 17 09:34:59 CET 2014


vlc/vlc-2.2 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Nov 11 18:50:49 2014 +0100| [81457d29ea424d8e56f489e474761b69f92c457c] | committer: Jean-Baptiste Kempf

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

(cherry picked from commit 394c36356e1c59df350ccf287265e3eed4eaf07c)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=81457d29ea424d8e56f489e474761b69f92c457c
---

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

diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c
index d69a675..5fd8e9a 100644
--- a/modules/demux/ogg.c
+++ b/modules/demux/ogg.c
@@ -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;
     }



More information about the vlc-commits mailing list