hello
     i am working on mp3 acm decoder driver for wince os. and the codec 
     provided by lame is working fine.
     
     it call the following function when the streamConvert message. is 
     called ..
     aad->convert(adsi, adsh->pbSrc, &nsrc, adsh->pbDst, &ndst);
     
     and corresponding function implementation is 
     
     static void mp3_horse(PACMDRVSTREAMINSTANCE adsi,
                           const unsigned char* src, LPDWORD nsrc,
                           unsigned char* dst, LPDWORD ndst)
     {
         AcmMpeg3Data*       amd = (AcmMpeg3Data*)adsi->dwDriver;
         int                 size, ret;
         DWORD               dpos = 0;
     
         ret = decodeMP3(&amd->mp, (unsigned char*)src, *nsrc, dst, *ndst, 
     &size);
        if (ret != MP3_OK)
         {
             DEBUGMSG (1, (TEXT("******* we are in ret ******* \r\n")));
                *ndst = *nsrc = 0;
             return;
         }
         do {
             DEBUGMSG (1, (TEXT("******* we are in do ******* \r\n")));
                dpos += size;
             if (*ndst - dpos < 4608) break;
             ret = decodeMP3(&amd->mp, NULL, 0, dst + dpos, *ndst - dpos, 
     &size);
         } while (ret == MP3_OK);
         *ndst = dpos;
     }
     
     but when i change the convert function parameter to 
     aad->convert(adsi,adsh);
     and the mp3_horse to 
     static void mp3_horse(LPACMDRVSTREAMINSTANCE adsi,LPACMDRVSTREAMHEADER 
     adsh)
     {
         AcmMpeg3Data*       amd = (AcmMpeg3Data*)adsi->dwDriver;
         int                 size, ret;
         DWORD               dpos = 0;
        
        ret = decodeMP3(&amd->mp,adsh->pbSrc,adsh->cbSrcLength,adsh->pbDst,
                                        adsh->cbDstLength, &size);
     if(ret !=0) {
                adsh->cbSrcLengthUsed = 0;
                adsh->cbDstLengthUsed = 0;
                return;
        }
        
         do {
             DEBUGMSG (1, (TEXT("******* we are in do ******* \r\n")));
                dpos += size;
             if (adsh->cbDstLength - dpos < 4608) break;
             ret = decodeMP3(&amd->mp, NULL,0, adsh->pbDst + dpos,          
                        adsh->cbDstLength- dpos, &size);
        
         } while (ret == 0);
        adsh->cbDstLength=dpos;
        adsh->cbSrcLengthUsed = adsh->cbSrcLength;
        adsh->cbDstLengthUsed = adsh->cbDstLength;
        
     }
     
     when the driver is executed with an application it is giving error 
     [WARNING ("wapi_acmStreamConvert" @ 1963)] Invalid Parameter
     [WARNING ("mapWaveWriteBuffer" @ 1698)] !waveOutWrite: conversion 
     failed!
     
     can you please tell me where is the error lies....
     
     regards
     ashish srivastava

_______________________________________________
mp3encoder mailing list
[EMAIL PROTECTED]
http://minnie.tuhs.org/mailman/listinfo/mp3encoder

Reply via email to