[FFmpeg-devel] [PATCH] PCM: fail gracefully if the audio parameters are wrong.

Michael Niedermayer michaelni
Thu Apr 10 21:04:43 CEST 2008

On Thu, Apr 10, 2008 at 08:04:23PM +0200, Nicolas George wrote:
> Le duodi 22 germinal, an CCXVI, Michael Niedermayer a ?crit?:
> > First there are tabs
> I forgot to check that point, and I apologize for the wasted time.
> > Second the patch is fundamentally wrong as neither sample rate nor channels
> > are needed for demuxing raw.
> This point raises the question: what assumptions can be made about the
> streams shown by lavc? In particular, is it legal to assume that:
> - an audio stream has never a 0 channels count?
> - the denominator of the time_base is never 0?

libavformat will give you what it has, If some smart person sets the channel
count in the header to 0 (for non raw) then libavformat might very well give
you a audio stream with 0 channels. Such a stream may or may not be usefull
to you, but discarding it and giving you nothing but an error will not be
any better.

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080410/c72fff89/attachment.pgp>

More information about the ffmpeg-devel mailing list