Commit 4a87b4f8 authored by Antoine Cellerier's avatar Antoine Cellerier

backport AAC fix [13472]

parent 6471c806
...@@ -1270,9 +1270,28 @@ static int TrackCreateES( demux_t *p_demux, mp4_track_t *p_track, ...@@ -1270,9 +1270,28 @@ static int TrackCreateES( demux_t *p_demux, mp4_track_t *p_track,
case( VLC_FOURCC( 'm', 's', 0x00, 0x55 ) ): case( VLC_FOURCC( 'm', 's', 0x00, 0x55 ) ):
p_track->fmt.i_codec = VLC_FOURCC( 'm', 'p', 'g', 'a' ); p_track->fmt.i_codec = VLC_FOURCC( 'm', 'p', 'g', 'a' );
break; break;
case( VLC_FOURCC( 'r', 'a', 'w', ' ' ) ): case( VLC_FOURCC( 'r', 'a', 'w', ' ' ) ):
p_track->fmt.i_codec = VLC_FOURCC( 'a', 'r', 'a', 'w' ); p_track->fmt.i_codec = VLC_FOURCC( 'a', 'r', 'a', 'w' );
/* Buggy files workaround */
if( p_sample->data.p_sample_soun && (p_track->i_timescale !=
p_sample->data.p_sample_soun->i_sampleratehi) )
{
MP4_Box_data_sample_soun_t *p_soun =
p_sample->data.p_sample_soun;
msg_Warn( p_demux, "i_timescale ("I64Fu") != i_sampleratehi "
"(%u), making both equal (report any problem).",
p_track->i_timescale, p_soun->i_sampleratehi );
if( p_soun->i_sampleratehi )
p_track->i_timescale = p_soun->i_sampleratehi;
else
p_soun->i_sampleratehi = p_track->i_timescale;
}
break; break;
case( VLC_FOURCC( 's', '2', '6', '3' ) ): case( VLC_FOURCC( 's', '2', '6', '3' ) ):
p_track->fmt.i_codec = VLC_FOURCC( 'h', '2', '6', '3' ); p_track->fmt.i_codec = VLC_FOURCC( 'h', '2', '6', '3' );
break; break;
...@@ -1848,32 +1867,6 @@ static void MP4_TrackCreate( demux_t *p_demux, mp4_track_t *p_track, ...@@ -1848,32 +1867,6 @@ static void MP4_TrackCreate( demux_t *p_demux, mp4_track_t *p_track,
} }
} }
/* fxi i_timescale for AUDIO_ES with i_qt_version == 0 */
if( p_track->fmt.i_cat == AUDIO_ES ) //&& p_track->i_sample_size == 1 )
{
MP4_Box_t *p_sample;
p_sample = MP4_BoxGet( p_track->p_stsd, "[0]" );
if( p_sample && p_sample->data.p_sample_soun)
{
MP4_Box_data_sample_soun_t *p_soun = p_sample->data.p_sample_soun;
if( p_soun->i_qt_version == 0 &&
p_track->i_timescale != p_soun->i_sampleratehi )
{
msg_Warn( p_demux,
"i_timescale ("I64Fu") != i_sampleratehi (%u) with "
"qt_version == 0\n"
"Making both equal. (report any problem)",
p_track->i_timescale, p_soun->i_sampleratehi );
if( p_soun->i_sampleratehi )
p_track->i_timescale = p_soun->i_sampleratehi;
else
p_soun->i_sampleratehi = p_track->i_timescale;
}
}
}
/* Create chunk index table and sample index table */ /* Create chunk index table and sample index table */
if( TrackCreateChunksIndex( p_demux,p_track ) || if( TrackCreateChunksIndex( p_demux,p_track ) ||
TrackCreateSamplesIndex( p_demux, p_track ) ) TrackCreateSamplesIndex( p_demux, p_track ) )
......
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