[FFmpeg-devel] [PATCH] play aiff without common tag

Michel Bardiaux mbardiaux
Mon Jun 25 18:34:20 CEST 2007


Baptiste Coudurier wrote:
> Hi Reimar,
> 
> Reimar D?ffinger wrote:
>> Hello,
>> attached patch fixes
>> http://samples.mplayerhq.hu/AIFF/invalid_nocommon.aiff.
>> While according to the specification says this file invalid I think it
>> is preferable to support it anyway, esp. because leaving values
>> uninitialized and even causing a division by zero is really bad anyway
>> (and it even leaves e.g. MPlayer thinking this is a video file...).
>>
> 
> Division by zero must be fixed of course.
> 
>> @@ -312,6 +305,11 @@
>>      st = av_new_stream(s, 0);
>>      if (!st)
>>          return AVERROR_NOMEM;
>> +    st->codec->codec_type = CODEC_TYPE_AUDIO;
>> +    st->codec->codec_id = CODEC_ID_PCM_S16BE;
>> +    st->codec->bits_per_sample = 16;
>> +    st->codec->sample_rate = 11025;
>> +    st->codec->channels = 2;
>>  
> 
> Humm, what do we do if a file containing PCM_S24BE, 4 channels at 48khz
> miss COMM chunk ?
> 
> I would be more in favor of returning -1 and saying the file is broken
> here, there is not much we can do to workaround.
> 
And even if it was possible to reliably guess properties of a broken 
file, that should never be done silently. An av_log(AV_LOG_ERROR) seems 
the minimum necessary. ffmpeg is inscrutable enough as it is!

That's the general principle; in this particular case, I agree with 
Baptiste: the proposed workaround is not reliable enough.

I remember (a long time ago!) my ADA compiler that would write "Problem 
such-and-suc. Processing apprehensively..."

-- 
Michel Bardiaux
R&D Director
T +32 [0] 2 790 29 41
F +32 [0] 2 790 29 02
E mailto:mbardiaux at mediaxim.be

Mediaxim NV/SA
Vorstlaan 191 Boulevard du Souverain
Brussel 1160 Bruxelles
http://www.mediaxim.com/




More information about the ffmpeg-devel mailing list