0, size);
sstart, size);
AVDMProcessAudioStream *buildInternalAudioFilter(AVDMGenericAudioStream *currentaudiostream,				uint32_t starttime, uint32_t size){    AVDMProcessAudioStream *firstFilter = NULL;    AVDMProcessAudioStream *lastFilter = NULL;    AVDMProcessAudioStream *normalize = NULL;    AVDMProcessAudioStream *downsample = NULL;    AVDMProcessAudioStream *resample = NULL;    AVDMProcessAudioStream *tshift = NULL;    AVDMProcessAudioStream *drc = NULL;    printf("\n Audio codec : %d",activeAudioEncoder);// In fact it is more a decompress filter than a null filter///* Mean: Ugly hack, in case of Film2Pal filter, the filter will need		more samples in than out (assuming we changed the fps)	So we correct the filter length beforehand to avoid the 24/25 too short audio */		/*   */	if(audioFilmConv==FILMCONV_FILM2PAL)		{		double d;		d=size;		d*=25000;		d/=23976;		size=(uint32_t)floor(d);		size=(size+1)&0xfffffffe;	}//_______________________________________________________    if (audioDelay && audioShift)      {                printf("\n Time shift activated with %d %d ms", audioShift,audioDelay);                // Depending on starttime & delay                // we may have or not to add silence                int32_t sstart=(int32_t)starttime;                                if (sstart>=audioDelay) // just seek in the file                {                        firstFilter = new AVDMProcessAudio_Null(currentaudiostream,                                            sstart-audioDelay, size);                        filtercount = 0;                        lastFilter = firstFilter;                        filters[filtercount++] = firstFilter;                }                else    // We have to add a silence of -sstart seconds                {                                        // First the raw one                         firstFilter = new AVDMProcessAudio_Null(currentaudiostream,                                            0, size);                        filtercount = 0;                        lastFilter = firstFilter;                        filters[filtercount++] = firstFilter;                        // Then the silence                        AVDMProcessAudio_TimeShift *ts;                        ts = new AVDMProcessAudio_TimeShift(lastFilter, sstart);                        tshift = (AVDMProcessAudioStream *) ts;                        lastFilter = tshift;                                                filters[filtercount++] = lastFilter;                }      }      else // no delay    {        firstFilter = new AVDMProcessAudio_Null(currentaudiostream,                                            starttime, size);        filtercount = 0;        lastFilter = firstFilter;        filters[filtercount++] = firstFilter;    }//_______________________________________________________    if ( audioNormalizeMode)	// Normalize activated ?      {	  printf("\n  normalize activated...\n");	  normalize = new AVDMProcessAudio_Normalize(lastFilter);	  lastFilter = normalize;	  filters[filtercount++] = lastFilter;	  // Preprocess input if needed....	  currentaudiostream->beginDecompress();	  normalize->preprocess();	  currentaudiostream->endDecompress();      }    if (audioDRC)      {	  AVDMProcessAudio_Compress *pdrc = NULL;	  printf("\n  DRC activated...\n");	  pdrc = new AVDMProcessAudio_Compress(lastFilter,&drcSetup);	  drc = (AVDMProcessAudioStream *) pdrc;	  lastFilter = drc;	  filters[filtercount++] = lastFilter;      }      switch(audioResampleMode)      {      	      	case RESAMPLING_NONE: break;	case RESAMPLING_DOWNSAMPLING:	 	if ((lastFilter->getInfo()->frequency != 48000) 	  		||  (lastFilter->getInfo()->channels != 2)			)	    	{			GUI_Info_HIG("Downsample disabled", "Input is not stereo, 48 kHz.");	  	} 		else	    	{			printf("\n downsample activated....");			downsample = new AVDMProcessAudio_Resample(lastFilter, 2);			lastFilter = downsample;			filters[filtercount++] = lastFilter;	    	}		break;	case RESAMPLING_CUSTOM:		printf("\n resampling to %d\n",audioFreq);		resample = new AVDMProcessAudio_SoxResample(lastFilter, audioFreq);		lastFilter = resample;		filters[filtercount++] = lastFilter;			break;			      	}	      switch(audioFilmConv)      {      	default:		ADM_assert(0);      	case FILMCONV_NONE:		break;	case FILMCONV_PAL2FILM:			 AVDMProcessAudio_Pal2Film *p2f;		printf("\n Pal2Film\n");				p2f = new AVDMProcessAudio_Pal2Film(lastFilter);		lastFilter = p2f;		filters[filtercount++] = lastFilter;			break;	 			case FILMCONV_FILM2PAL:		AVDMProcessAudio_Film2Pal *f2p;		printf("\n Film2pal\n");				f2p = new AVDMProcessAudio_Film2Pal(lastFilter);		lastFilter = f2p;		filters[filtercount++] = lastFilter;			break;			      	}   	switch(audioChannelConv)	{		case CHANNELCONV_NONE:break;		case CHANNELCONV_2to1:				AVDMProcessStereo2Mono *s2m;				s2m = new AVDMProcessStereo2Mono(lastFilter);				lastFilter = s2m;				filters[filtercount++] = lastFilter;					break;		case CHANNELCONV_1to2:				AVDMProcessMono2Stereo *m2s;				m2s = new AVDMProcessMono2Stereo(lastFilter);				lastFilter = m2s;				filters[filtercount++] = lastFilter;					break;		default:				ADM_assert(0);			}   				//_______________________________________________________    currentaudiostream->beginDecompress();    return lastFilter;}