changeset 20328:5d9f47834495

Do not use sh_audio->wf values if they are definitely invalid
author reimar
date Sat, 21 Oct 2006 17:01:45 +0000
parents 5e5e6c0a98c3
children a0919fb6bfaf
files libmpcodecs/ad_ffmpeg.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/ad_ffmpeg.c	Sat Oct 21 15:57:08 2006 +0000
+++ b/libmpcodecs/ad_ffmpeg.c	Sat Oct 21 17:01:45 2006 +0000
@@ -115,7 +115,9 @@
   if(sh_audio->wf){
       // If the decoder uses the wrong number of channels all is lost anyway.
       // sh_audio->channels=sh_audio->wf->nChannels;
+      if (sh_audio->wf->nSamplesPerSec)
       sh_audio->samplerate=sh_audio->wf->nSamplesPerSec;
+      if (sh_audio->wf->nAvgBytesPerSec)
       sh_audio->i_bps=sh_audio->wf->nAvgBytesPerSec;
   }
   sh_audio->samplesize=2;