Commit ed21c7bd authored by Francois Cartegnie's avatar Francois Cartegnie

demux: avi: add workaround for broken ADPCM rate/scale (fix #12726)

Some muxer is trowing incorrect rate/scale and then duration.
As we're not computing pts from fully decoded samples, we need
a correct pts for avcodec input. Fix is possible since ADPCM uses
a fixed bits/sample and header.
parent c190e381
......@@ -451,6 +451,14 @@ static int Open( vlc_object_t * p_this )
tk->i_samplesize = 0; /* ADTS/AAC VBR */
}
/* Fix broken scale/rate */
if ( tk->i_codec == VLC_CODEC_ADPCM_IMA_WAV &&
tk->i_samplesize && tk->i_samplesize > tk->i_rate )
{
tk->i_scale = 1017;
tk->i_rate = p_auds->p_wf->nSamplesPerSec;
}
es_format_Init( &fmt, AUDIO_ES, tk->i_codec );
fmt.audio.i_channels = p_auds->p_wf->nChannels;
......
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