if(audioFilmConv==FILMCONV_FILM2PAL) { double d; d=size; d*=25000; d/=23976; size=(uint32_t)floor(d); size=(size+1)&0xfffffffe; }
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//    firstFilter = new AVDMProcessAudio_Null(currentaudiostream,					    starttime, size);    filtercount = 0;    lastFilter = firstFilter;    filters[filtercount++] = firstFilter;//_______________________________________________________    if (audioDelay)      {	  if (audioShift)	    {		AVDMProcessAudio_TimeShift *ts;		ts = new AVDMProcessAudio_TimeShift(lastFilter,						    audioDelay);		tshift = (AVDMProcessAudioStream *) ts;		lastFilter = tshift;		printf("\n Time shift activated with %d ms", audioShift);		filters[filtercount++] = lastFilter;	    }      }//_______________________________________________________    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);	  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_Alert(" input is not stereo@48 khz\n Downsample disabled\n");	  	} 		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:		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;			      	}      				//_______________________________________________________    currentaudiostream->beginDecompress();    return lastFilter;}