[vlc-commits] Handle case where dwFormat is WAVE_FORMAT_EXTENSIBLE

Denis Charmet git at videolan.org
Fri Feb 8 21:37:59 CET 2013


vlc | branch: master | Denis Charmet <typx at dinauz.org> | Fri Feb  8 21:37:01 2013 +0100| [af8c1f653551e97bd30bcfbc4e41c0a04fa89df8] | committer: Denis Charmet

Handle case where dwFormat is WAVE_FORMAT_EXTENSIBLE

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

 modules/demux/mkv/matroska_segment_parse.cpp |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/modules/demux/mkv/matroska_segment_parse.cpp b/modules/demux/mkv/matroska_segment_parse.cpp
index 697660d..07288a8 100644
--- a/modules/demux/mkv/matroska_segment_parse.cpp
+++ b/modules/demux/mkv/matroska_segment_parse.cpp
@@ -1305,8 +1305,15 @@ int32_t matroska_segment_c::TrackInit( mkv_track_t * p_tk )
         else
         {
             WAVEFORMATEX *p_wf = (WAVEFORMATEX*)p_tk->p_extra_data;
-
-            wf_tag_to_fourcc( GetWLE( &p_wf->wFormatTag ), &p_tk->fmt.i_codec, NULL );
+            if( p_wf->wFormatTag == WAVE_FORMAT_EXTENSIBLE && 
+                p_tk->i_extra_data >= sizeof(WAVEFORMATEXTENSIBLE) )
+            {
+                WAVEFORMATEXTENSIBLE * p_wext = (WAVEFORMATEXTENSIBLE*) p_wf;
+                sf_tag_to_fourcc( &p_wext->SubFormat,  &p_tk->fmt.i_codec, NULL);
+                /* FIXME should we use Samples and dwChannelMask?*/
+            }
+            else
+                wf_tag_to_fourcc( GetWLE( &p_wf->wFormatTag ), &p_tk->fmt.i_codec, NULL );
 
             if( p_tk->fmt.i_codec == VLC_FOURCC( 'u', 'n', 'd', 'f' ) )
                 msg_Err( &sys.demuxer, "Unrecognized wf tag: 0x%x", GetWLE( &p_wf->wFormatTag ) );



More information about the vlc-commits mailing list