Commit d54bd1fc authored by François Cartegnie's avatar François Cartegnie 🤞
Browse files

demux: mp4: handle Qt v1 redefined samples tables (fix #12773)

parent ab1213b2
......@@ -441,15 +441,18 @@ int SetupAudioES( demux_t *p_demux, mp4_track_t *p_track, MP4_Box_t *p_sample )
default:
break;
}
}
if( p_track->i_sample_size != 0 && p_soun->i_qt_version == 1 &&
p_soun->i_sample_per_packet <= 0 )
if ( p_sample->data.p_sample_soun->i_compressionid == 0xFFFE /* -2 */)
{
/* redefined sample tables for vbr audio */
}
else if ( p_track->i_sample_size != 0 && p_soun->i_sample_per_packet == 0 )
{
msg_Err( p_demux, "Invalid sample per packet value for qt_version 1. Broken muxer!" );
msg_Err( p_demux, "Invalid sample per packet value for qt_version 1. Broken muxer! %u %u",
p_track->i_sample_size, p_soun->i_sample_per_packet );
p_soun->i_qt_version = 0;
}
}
/* Endianness atom */
const MP4_Box_t *p_enda = MP4_BoxGet( p_sample, "wave/enda" );
......
......@@ -3020,7 +3020,15 @@ static uint32_t MP4_TrackGetReadSize( mp4_track_t *p_track, uint32_t *pi_nb_samp
if( p_soun->i_qt_version == 1 )
{
if ( p_soun->i_compressionid != 0 || p_soun->i_bytes_per_sample > 1 ) /* compressed */
if ( p_soun->i_compressionid == 0xFFFE )
{
*pi_nb_samples = 1; /* != number of audio samples */
if ( p_track->i_sample_size )
return p_track->i_sample_size;
else
return p_track->p_sample_size[p_track->i_sample];
}
else if ( p_soun->i_compressionid != 0 || p_soun->i_bytes_per_sample > 1 ) /* compressed */
{
/* in this case we are dealing with compressed data
-2 in V1: additional fields are meaningless (VBR and such) */
......
Supports Markdown
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