changeset 3466:b6caac381405

avifile merge
author arpi
date Tue, 11 Dec 2001 23:29:11 +0000
parents 4dad31e655b6
children e3bbf44dbab2
files loader/dshow/DS_AudioDecoder.c loader/dshow/DS_VideoDecoder.c
diffstat 2 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/loader/dshow/DS_AudioDecoder.c	Tue Dec 11 22:58:14 2001 +0000
+++ b/loader/dshow/DS_AudioDecoder.c	Tue Dec 11 23:29:11 2001 +0000
@@ -72,6 +72,10 @@
     this->m_sDestType.bFixedSizeSamples=1;
     this->m_sDestType.bTemporalCompression=0;
     this->m_sDestType.lSampleSize=2*wf->nChannels;
+    if (wf->wFormatTag == 0x130)
+	// ACEL hack to prevent memory corruption
+        // obviosly we are missing something here
+	this->m_sDestType.lSampleSize *= 288;
     this->m_sDestType.pUnk=0;
     this->m_sDestType.cbFormat=pWF->cbSize;
     this->m_sDestType.pbFormat=this->m_sVhdr2;
@@ -144,9 +148,9 @@
 	    Debug printf("DS_AudioDecoder::Convert() Error: null sample\n");
 	    break;
 	}
+	sample->vt->SetActualDataLength(sample, this->in_fmt.nBlockAlign);
 	sample->vt->GetPointer(sample, (BYTE **)&ptr);
 	memcpy(ptr, (const uint8_t*)in_data + read, this->in_fmt.nBlockAlign);
-	sample->vt->SetActualDataLength(sample, this->in_fmt.nBlockAlign);
 	sample->vt->SetSyncPoint(sample, 1);
 	sample->vt->SetPreroll(sample, 0);
 	result = this->m_pDS_Filter->m_pImp->vt->Receive(this->m_pDS_Filter->m_pImp, sample);
@@ -161,6 +165,7 @@
         sample->vt->Release((IUnknown*)sample);
 	read+=this->in_fmt.nBlockAlign;
 	written+=frame_size;
+	break;
     }
     if (size_read)
 	*size_read = read;
--- a/loader/dshow/DS_VideoDecoder.c	Tue Dec 11 22:58:14 2001 +0000
+++ b/loader/dshow/DS_VideoDecoder.c	Tue Dec 11 23:29:11 2001 +0000
@@ -152,14 +152,14 @@
 
 	if (!flip)
 	{
-	    this->m_sVhdr2->bmiHeader.biHeight *= -1;
 	    this->iv.m_obh.biHeight *= -1;
+	    this->m_sVhdr2->bmiHeader.biHeight = this->iv.m_obh.biHeight;
 	    result = this->m_pDS_Filter->m_pOutputPin->vt->QueryAccept(this->m_pDS_Filter->m_pOutputPin, &this->m_sDestType);
 	    if (result)
 	    {
-		printf("Decoder does not support upside-down frames\n");
-		this->m_sVhdr2->bmiHeader.biHeight *= -1;
+		printf("Decoder does not support upside-down RGB frames\n");
 		this->iv.m_obh.biHeight *= -1;
+		this->m_sVhdr2->bmiHeader.biHeight = this->iv.m_obh.biHeight;
 	    }
 	}
 
@@ -280,9 +280,9 @@
     }
 
 
+    sample->vt->SetActualDataLength(sample, size);
     sample->vt->GetPointer(sample, (BYTE **)&ptr);
     memcpy(ptr, src, size);
-    sample->vt->SetActualDataLength(sample, size);
     sample->vt->SetSyncPoint(sample, is_keyframe);
     sample->vt->SetPreroll(sample, pImage ? 0 : 1);
     // sample->vt->SetMediaType(sample, &m_sOurType);