uint8_t * buf;
uint8_t * obuf;
hb_list_t * list;
- int64_t pts;
- int64_t framedur;
+ double pts;
+ double framedur;
int out_discrete_channels;
};
&pv->input_samples, &pv->output_bytes );
pv->buf = malloc( pv->input_samples * sizeof( float ) );
pv->obuf = malloc( pv->output_bytes );
- pv->framedur = 90000LL * pv->input_samples /
+ pv->framedur = 90000.0 * pv->input_samples /
( audio->config.out.samplerate * pv->out_discrete_channels );
+printf("in %ld out %ld sr %d dur %g\n", pv->input_samples, pv->output_bytes, audio->config.out.samplerate, pv->framedur);
cfg = faacEncGetCurrentConfiguration( pv->faac );
cfg->mpegVersion = MPEG4;
typedef struct
{
int index;
- int64_t next_start; /* start time of next output frame */
+ double next_start; /* start time of next output frame */
int64_t next_pts; /* start time of next input frame */
int64_t first_drop; /* PTS of first 'went backwards' frame dropped */
int drop_count; /* count of 'time went backwards' drops */
static hb_buffer_t * OutputAudioFrame( hb_audio_t *audio, hb_buffer_t *buf,
hb_sync_audio_t *sync )
{
- int64_t start = sync->next_start;
- int64_t duration = buf->stop - buf->start;
+ int64_t start = (int64_t)sync->next_start;
+ double duration = buf->stop - buf->start;
sync->next_pts += duration;
hb_buffer_close( &buf_raw );
buf->size = sync->data.output_frames_gen * channel_count;
- duration = ( sync->data.output_frames_gen * 90000 ) /
+ duration = (double)( sync->data.output_frames_gen * 90000 ) /
audio->config.out.samplerate;
}
buf->frametype = HB_FRAME_AUDIO;
buf->start = start;
- buf->stop = start + duration;
- sync->next_start = start + duration;
+ sync->next_start += duration;
+ buf->stop = (int64_t)sync->next_start;
return buf;
}