Allow playback of in24 little-endian or big-endian in mov files.
authorPavlov Konstantin <thresh@videolan.org>
Wed, 11 Jul 2007 13:08:55 +0000 (13:08 +0000)
committerPavlov Konstantin <thresh@videolan.org>
Wed, 11 Jul 2007 13:08:55 +0000 (13:08 +0000)
to check:
ffmpeg -i 01\ Sam\'s\ Town.mp3 -ac 1 -acodec pcm_s24be 24be.mov
ffmpeg -i 01\ Sam\'s\ Town.mp3 -ac 1 -acodec pcm_s24le 24le.mov
Patch by Ilkka Ollakka.

modules/codec/araw.c
modules/demux/mp4/mp4.c

index 3f8ff0a..478bb5a 100644 (file)
@@ -197,6 +197,7 @@ static int DecoderOpen( vlc_object_t *p_this )
     case VLC_FOURCC('s','8',' ',' '):
     case VLC_FOURCC('u','8',' ',' '):
     case VLC_FOURCC('i','n','2','4'): /* Quicktime in24, bigendian int24 */
+    case VLC_FOURCC('4','2','n','i'): /* Quicktime in24, little-endian int24 */
     case VLC_FOURCC('i','n','3','2'): /* Quicktime in32, bigendian int32 */
         break;
 
@@ -263,8 +264,11 @@ static int DecoderOpen( vlc_object_t *p_this )
     }
     else if( p_dec->fmt_in.i_codec == VLC_FOURCC( 'i', 'n', '2', '4' ) )
     {
-        /* FIXME: mplayer uses bigendian for in24 .... but here it works
-         * with little endian ... weird */
+        p_dec->fmt_out.i_codec = VLC_FOURCC( 's', '2', '4', 'b' );
+        p_dec->fmt_in.audio.i_bitspersample = 24;
+    }
+    else if( p_dec->fmt_in.i_codec == VLC_FOURCC( '4', '2', 'n', 'i' ) )
+    {
         p_dec->fmt_out.i_codec = VLC_FOURCC( 's', '2', '4', 'l' );
         p_dec->fmt_in.audio.i_bitspersample = 24;
     }
index a76652b..cafbb93 100644 (file)
@@ -1477,6 +1477,17 @@ static int TrackCreateES( demux_t *p_demux, mp4_track_t *p_track,
             p_track->fmt.i_codec = VLC_FOURCC('Y','U','Y','2');
             break;
 
+        case VLC_FOURCC('i','n','2','4'):
+            /* in in24/in32 there's enda-atom to tell it's little-endian (if present) */
+            if( ( MP4_BoxGet( p_sample, "wave/enda" ) ) ||
+                ( MP4_BoxGet( p_sample, "enda" ) ) )
+            {
+                p_track->fmt.i_codec = VLC_FOURCC('4','2','n','i');
+            } else {
+                p_track->fmt.i_codec = p_sample->i_type;
+            }
+            break;
+
         default:
             p_track->fmt.i_codec = p_sample->i_type;
             break;