[vlc-commits] demux: avi: handle broken samplespp == samplesize (really fix #12722)

Francois Cartegnie git at videolan.org
Fri Nov 11 14:18:56 CET 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Nov 11 14:16:30 2016 +0100| [5c36c934a27675234512203988f50c24e6f94fa4] | committer: Francois Cartegnie

demux: avi: handle broken samplespp == samplesize (really fix #12722)

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

 modules/demux/avi/avi.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
index c7bacdc..1939b28 100644
--- a/modules/demux/avi/avi.c
+++ b/modules/demux/avi/avi.c
@@ -470,6 +470,14 @@ static int Open( vlc_object_t * p_this )
                     tk->i_rate = p_auds->p_wf->nSamplesPerSec;
                 }
 
+                /* From libavformat */
+                /* Fix broken sample size (which is mp2 num samples / frame) #12722 */
+                if( tk->i_codec == VLC_CODEC_MPGA &&
+                    tk->i_samplesize == 1152 && p_auds->p_wf->nBlockAlign == 1152 )
+                {
+                    p_auds->p_wf->nBlockAlign = tk->i_samplesize = 0;
+                }
+
                 es_format_Init( &fmt, AUDIO_ES, tk->i_codec );
 
                 fmt.audio.i_channels        = p_auds->p_wf->nChannels;



More information about the vlc-commits mailing list