[mythtv] Can anybody enhance this function? or add something like this in a better way?

Vijay Gill vijay.s.gill at gmail.com
Thu Mar 3 20:30:17 UTC 2005


Hi,
   I use mythtranscode (from 0.17) + mencoder to encode my recordings
to mpeg2. Almost every program contains a loud noise at the beginning,
so I started looking at the code of mythtranscode. In transcode.cpp I
added following

#define MAX_FADE_IN 25;

int fade_in_audio(long currFrame, unsigned char buff[], long buffsize)
{
  int ctr;
  int max_fade_in = MAX_FADE_IN;
  if (currFrame < max_fade_in)
    for( ctr=0; ctr<buffsize; ctr++)
      buff[ctr] = 0;
  return 0;
}

and somewhere in the same file (it was aboult like 571) i added call
to this function

            // int buflen = (int)(arb->audiobuffer_len / rateTimeConv);
            // cout << curFrameNum << ": video time: " << frame.timecode
            //      << " audio time: " << arb->last_audiotime << " buf: "
            //      << buflen << " exp: "
            //      << audbufTime << " delta: " << delta << endl;
            if (arb->audiobuffer_len)
             {
                //call to my function
                fade_in_audio(curFrameNum, arb->audiobuffer,
arb->audiobuffer_len);
                fifow->FIFOWrite(1, arb->audiobuffer, arb->audiobuffer_len);
             }


Honestly speaking i started it as a fade in feature but could not get
it working except for adding silence.

Can somebody really make it work like fade-in? And parameter to define
fade-in length can be passed via command line (default say 1 second).

Regards from
VJ


More information about the mythtv-dev mailing list