Commit b48f3dec authored by Pavlov Konstantin's avatar Pavlov Konstantin

Allow playback of in24 little-endian or big-endian in mov files.

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.
parent 21e8d456
......@@ -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;
}
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment