From: Charles Y. <cha...@pa...> - 2002-12-03 07:14:06
|
On Tue, 2002-12-03 at 01:48, Charles 'Buck' Krasic wrote: > Umm. It is optional right? That's what the emphasis flag in > dv_audio_t is for. Heh - guess that one had cost me so much time and I lost my patience with it. Fine, will change our use of this setting. > So just so I have this straight. The application calls > dv_calculate_samples() for every frame, before calling > dv_encode_full_audio(), right? When you're dubbing newly encoded frames from another audio source: encoder->isPAL = int samples = dv_calculate_samples(encoder, 44100, frame_count ++ ); ... get number of samples from audio source ... dv_encode_full_frame(encoder,....); However, when you wish to reapply an altered set of samples from an existing frame, then you don't need it, and the following will do: dv_parse_header(decoder, original_frame); encoder->isPAL = encoder->samples_this_frame = decoder->audio->samples_this_frame; ... obtain and do something with the samples ... dv_encode_full_frame(encoder,..., new_frame); This will ensure that the correct number of input samples are preserved in the output. Source code compatibility is maintained (if the existing implementation is good enough for your needs) and use of the new stuff can be optionally selected at compile time based on the macro provided. > You already have CVS access to libdv, right? Looks that way to me. Thanks. I will clean up, comment and post today. Cheers -- Charles Yates <cha...@pa...> |