]> git.sesse.net Git - vlc/commitdiff
Fixed playing of some twos/sowt samples (close #1621)
authorLaurent Aimar <fenrir@videolan.org>
Thu, 3 Jul 2008 18:34:16 +0000 (18:34 +0000)
committerLaurent Aimar <fenrir@videolan.org>
Thu, 3 Jul 2008 20:51:05 +0000 (20:51 +0000)
modules/demux/mp4/mp4.c

index 90ff72cce68a568adbbff027d6b52c1f40126da5..e7b4750fcd70165105d44781ea3891775b046a08 100644 (file)
@@ -1392,7 +1392,7 @@ static int TrackCreateES( demux_t *p_demux, mp4_track_t *p_track,
 
     p_track->p_sample = p_sample;
 
-    if( p_track->fmt.i_cat == AUDIO_ES && p_track->i_sample_size == 1 )
+    if( p_track->fmt.i_cat == AUDIO_ES && ( p_track->i_sample_size == 1 || p_track->i_sample_size == 2 ) )
     {
         MP4_Box_data_sample_soun_t *p_soun;
 
@@ -1427,6 +1427,11 @@ static int TrackCreateES( demux_t *p_demux, mp4_track_t *p_track,
                 case VLC_FOURCC( 'u', 'l', 'a', 'w' ):
                     p_soun->i_samplesize = 8;
                     break;
+                case VLC_FOURCC( 't', 'w', 'o', 's' ):
+                case VLC_FOURCC( 's', 'o', 'w', 't' ):
+                    /* What would be the fun if you could trust the .mov */
+                    p_track->i_sample_size = ((p_soun->i_samplesize+7)/8) * p_soun->i_channelcount;
+                    break;
                 default:
                     break;
             }
@@ -1438,7 +1443,6 @@ static int TrackCreateES( demux_t *p_demux, mp4_track_t *p_track,
         }
     }
 
-
     /* It's a little ugly but .. there are special cases */
     switch( p_sample->i_type )
     {