hb_chapter_t *c = hb_list_item( pv->job->title->list_chapter, chap_num - 1 );
if ( c && c->title )
{
- hb_log( "%s: \"%s\" (%d) at frame %u time %lld",
+ hb_log( "%s: \"%s\" (%d) at frame %u time %"PRId64,
pv->context->codec->name, c->title, chap_num, pv->nframes, pts );
}
else
{
- hb_log( "%s: Chapter %d at frame %u time %lld",
+ hb_log( "%s: Chapter %d at frame %u time %"PRId64,
pv->context->codec->name, chap_num, pv->nframes, pts );
}
}
chapter->minutes = ( ( chapter->duration / 90000 ) % 3600 ) / 60;
chapter->seconds = ( chapter->duration / 90000 ) % 60;
strcpy( chapter->title, chapter_list[i-1].title );
- hb_deep_log( 2, "Added chapter %i, name='%s', dur=%lld, (%02i:%02i:%02i)", chapter->index, chapter->title,
+ hb_deep_log( 2, "Added chapter %i, name='%s', dur=%"PRId64", (%02i:%02i:%02i)", chapter->index, chapter->title,
chapter->duration, chapter->hours,
chapter->minutes, chapter->seconds);
hb_list_add( title->list_chapter, chapter );
buf->new_chap - 1 );
chap_name = c->title;
}
- hb_log( "mpeg2: \"%s\" (%d) at frame %u time %lld",
+ hb_log( "mpeg2: \"%s\" (%d) at frame %u time %"PRId64,
chap_name, buf->new_chap, m->nframes, buf->start );
} else if ( m->nframes == 0 && m->job &&
hb_list_item( m->job->title->list_chapter,
{
hb_chapter_t * c = hb_list_item( m->job->title->list_chapter,
m->job->chapter_start - 1 );
- hb_log( "mpeg2: \"%s\" (%d) at frame %u time %lld", c->title,
+ hb_log( "mpeg2: \"%s\" (%d) at frame %u time %"PRId64, c->title,
m->job->chapter_start, m->nframes, buf->start );
}
++m->nframes;
if( !( start_time > pv->start_time && stop_time < pv->stop_time ) )
{
- hb_deep_log( 3, "Discarding SRT at time start %lld, stop %lld", start_time, stop_time);
+ hb_deep_log( 3, "Discarding SRT at time start %"PRId64", stop %"PRId64, start_time, stop_time);
memset( &pv->current_entry, 0, sizeof( srt_entry_t ) );
++(pv->number_of_entries);
pv->current_state = k_state_timecode;
retval = 0;
}
- hb_deep_log( 3, "SRT Start time %lld, stop time %lld", pv->start_time, pv->stop_time);
+ hb_deep_log( 3, "SRT Start time %"PRId64", stop time %"PRId64, pv->start_time, pv->stop_time);
pv->iconv_context = iconv_open( "utf8", pv->subtitle->config.src_codeset );
title->hours = title->duration / 90000 / 3600;
title->minutes = ( ( title->duration / 90000 ) % 3600 ) / 60;
title->seconds = ( title->duration / 90000 ) % 60;
- hb_log( "scan: duration is %02d:%02d:%02d (%lld ms)",
+ hb_log( "scan: duration is %02d:%02d:%02d (%"PRId64" ms)",
title->hours, title->minutes, title->seconds,
title->duration / 90 );
chapter->minutes = ( seconds % 3600 ) / 60;
chapter->seconds = seconds % 60;
- hb_log( "scan: chap %d c=%d->%d, b=%d->%d (%d), %lld ms",
+ hb_log( "scan: chap %d c=%d->%d, b=%d->%d (%d), %"PRId64" ms",
chapter->index, chapter->cell_start, chapter->cell_end,
chapter->block_start, chapter->block_end,
chapter->block_count, chapter->duration / 90 );
title->hours = title->duration / 90000 / 3600;
title->minutes = ( ( title->duration / 90000 ) % 3600 ) / 60;
title->seconds = ( title->duration / 90000 ) % 60;
- hb_log( "scan: duration is %02d:%02d:%02d (%lld ms)",
+ hb_log( "scan: duration is %02d:%02d:%02d (%"PRId64" ms)",
title->hours, title->minutes, title->seconds,
title->duration / 90 );
chapter->minutes = ( seconds % 3600 ) / 60;
chapter->seconds = seconds % 60;
- hb_log( "scan: chap %d c=%d->%d, b=%d->%d (%d), %lld ms",
+ hb_log( "scan: chap %d c=%d->%d, b=%d->%d (%d), %"PRId64" ms",
chapter->index, chapter->cell_start, chapter->cell_end,
chapter->block_start, chapter->block_end,
chapter->block_count, chapter->duration / 90 );
*/
if( pv->last_stop != in->start )
{
- hb_log("encx264 input continuity err: last stop %lld start %lld",
+ hb_log("encx264 input continuity err: last stop %"PRId64" start %"PRId64,
pv->last_stop, in->start);
}
pv->last_stop = in->stop;
}
}
- hb_deep_log( 2, "Allocated %lld bytes of buffers on this pass and Freed %lld bytes, "
- "%lld bytes leaked", buffers.allocated, freed, buffers.allocated - freed);
+ hb_deep_log( 2, "Allocated %"PRId64" bytes of buffers on this pass and Freed %"PRId64" bytes, "
+ "%"PRId64" bytes leaked", buffers.allocated, freed, buffers.allocated - freed);
buffers.allocated = 0;
hb_unlock(buffers.lock);
}
if( !stat( job->file, &sb ) )
{
- hb_deep_log( 2, "mux: file size, %lld bytes", (uint64_t) sb.st_size );
+ hb_deep_log( 2, "mux: file size, %"PRId64" bytes", (uint64_t) sb.st_size );
bytes_total = 0;
frames_total = 0;
for( i = 0; i < mux->ntracks; ++i )
{
track = mux->track[i];
- hb_log( "mux: track %d, %lld frames, %lld bytes, %.2f kbps, fifo %d",
+ hb_log( "mux: track %d, %"PRId64" frames, %"PRId64" bytes, %.2f kbps, fifo %d",
i, track->frames, track->bytes,
90000.0 * track->bytes / mux->pts / 125,
track->mf.flen );
if( !i && ( job->vquality < 0.0 || job->vquality > 1.0 ) )
{
/* Video */
- hb_deep_log( 2, "mux: video bitrate error, %+lld bytes",
+ hb_deep_log( 2, "mux: video bitrate error, %+"PRId64" bytes",
(int64_t)(track->bytes - mux->pts * job->vbitrate * 125 / 90000) );
}
bytes_total += track->bytes;
return 0;
}
- hb_deep_log( 2, "muxmp4: track %u, chunk duration %llu", MP4FindTrackIndex( m->file, trackId ), dur );
+ hb_deep_log( 2, "muxmp4: track %u, chunk duration %"PRIu64, MP4FindTrackIndex( m->file, trackId ), dur );
return 1;
}
offset = buf->start + m->init_delay - m->sum_dur;
if ( offset < 0 )
{
- hb_log("MP4Mux: illegal render offset %lld, start %lld,"
- "stop %lld, sum_dur %lld",
+ hb_log("MP4Mux: illegal render offset %"PRId64", start %"PRId64","
+ "stop %"PRId64", sum_dur %"PRId64,
offset, buf->start, buf->stop, m->sum_dur );
offset = 0;
}
be possible and usually indicates a bug in the upstream code.
Complain in the hope that someone will go find the bug but
try to fix the error so that the file will still be playable. */
- hb_log("MP4Mux: illegal duration %lld, start %lld,"
- "stop %lld, sum_dur %lld",
+ hb_log("MP4Mux: illegal duration %"PRId64", start %"PRId64","
+ "stop %"PRId64", sum_dur %"PRId64,
duration, buf->start, buf->stop, m->sum_dur );
/* we don't know when the next frame starts so we can't pick a
valid duration for this one. we pick something "short"
}
mux_data->sum_dur += (buf->stop - buf->start);
- hb_deep_log(3, "MuxMP4:Sub:%fs:%lld:%lld:%lld: %s", (float)buf->start / 90000, buf->start, buf->stop,
+ hb_deep_log(3, "MuxMP4:Sub:%fs:%"PRId64":%"PRId64":%"PRId64": %s", (float)buf->start / 90000, buf->start, buf->stop,
(buf->stop - buf->start), buf->data);
- hb_deep_log(3, "MuxMP4:Total time elapsed:%lld", mux_data->sum_dur);
+ hb_deep_log(3, "MuxMP4:Total time elapsed:%"PRId64, mux_data->sum_dur);
}
}
else
// force a new scr offset computation
r->scr_changes = r->demux.scr_changes - 1;
r->saw_video = 1;
- hb_log( "reader: first SCR %lld", r->demux.last_scr );
+ hb_log( "reader: first SCR %"PRId64, r->demux.last_scr );
}
else
{
/* Preserve dropped frame count for more accurate framerates in 2nd passes. */
interjob->render_dropped = pv->dropped_frames;
- hb_log("render: lost time: %lld (%i frames)", pv->total_lost_time, pv->dropped_frames);
- hb_log("render: gained time: %lld (%i frames) (%lld not accounted for)", pv->total_gained_time, pv->extended_frames, pv->total_lost_time - pv->total_gained_time);
+ hb_log("render: lost time: %"PRId64" (%i frames)", pv->total_lost_time, pv->dropped_frames);
+ hb_log("render: gained time: %"PRId64" (%i frames) (%"PRId64" not accounted for)", pv->total_gained_time, pv->extended_frames, pv->total_lost_time - pv->total_gained_time);
if (pv->dropped_frames)
- hb_log("render: average dropped frame duration: %lld", (pv->total_lost_time / pv->dropped_frames) );
+ hb_log("render: average dropped frame duration: %"PRId64, (pv->total_lost_time / pv->dropped_frames) );
/* Cleanup subtitle queue */
if( pv->subtitle_queue )
}
}
+static void ts_warn( hb_stream_t*, char*, ... ) HB_WPRINTF(2,3);
+static void ts_err( hb_stream_t*, int, char*, ... ) HB_WPRINTF(3,4);
+
static void ts_warn( hb_stream_t *stream, char *log, ... )
{
- va_list args;
+ va_list args;
va_start( args, log );
ts_warn_helper( stream, log, args );
va_end( args );
static void ts_err( hb_stream_t *stream, int curstream, char *log, ... )
{
- va_list args;
+ va_list args;
va_start( args, log );
ts_warn_helper( stream, log, args );
va_end( args );
off_t pos2 = align_to_next_packet(stream);
if ( pos2 == 0 )
{
- hb_log( "next_packet: eof while re-establishing sync @ %lld", pos );
+ hb_log( "next_packet: eof while re-establishing sync @ %"PRId64, pos );
return NULL;
}
- ts_warn( stream, "next_packet: sync lost @ %lld, regained after %lld bytes",
+ ts_warn( stream, "next_packet: sync lost @ %"PRId64", regained after %"PRId64" bytes",
pos, pos2 );
}
}
buf = hb_ts_stream_getPEStype( stream, stream->ts_video_pids[0] );
if ( buf == NULL )
{
- hb_log("hb_sample_pts: couldn't find video packet near %llu", fpos);
+ hb_log("hb_sample_pts: couldn't find video packet near %"PRIu64, fpos);
return pp;
}
if ( ( buf[7] >> 7 ) != 1 )
{
- hb_log("hb_sample_pts: no PTS in video packet near %llu", fpos);
+ hb_log("hb_sample_pts: no PTS in video packet near %"PRIu64, fpos);
return pp;
}
pp.pts = ( ( (uint64_t)buf[9] >> 1 ) & 7 << 30 ) |
int64_t pos = ( ( ( sum_dur - chapter->duration ) * AV_TIME_BASE ) / 90000 );
- hb_deep_log( 2, "Seeking to chapter %d: starts %lld, ends %lld, AV pos %lld",
+ hb_deep_log( 2, "Seeking to chapter %d: starts %"PRId64", ends %"PRId64", AV pos %"PRId64,
chapter_num, sum_dur - chapter->duration, sum_dur, pos);
if ( chapter_num > 1 && pos > 0 )
chapter->minutes = ( ( chapter->duration / 90000 ) % 3600 ) / 60;
chapter->seconds = ( chapter->duration / 90000 ) % 60;
strcpy( chapter->title, m->title );
- hb_deep_log( 2, "Added chapter %i, name='%s', dur=%llu, (%02i:%02i:%02i)",
+ hb_deep_log( 2, "Added chapter %i, name='%s', dur=%"PRIu64", (%02i:%02i:%02i)",
chapter->index, chapter->title,
chapter->duration, chapter->hours,
chapter->minutes, chapter->seconds );
{
stream->chapter_end += chapter->duration;
buf->new_chap = stream->chapter + 1;
- hb_deep_log( 2, "ffmpeg_read starting chapter %i at %lld",
+ hb_deep_log( 2, "ffmpeg_read starting chapter %i at %"PRId64,
buf->new_chap, buf->start);
} else {
// Must have run out of chapters, stop looking.
* as if it started at zero so that our audio timing will
* be in sync.
*/
- hb_log( "sync: first pts is %lld", cur->start );
+ hb_log( "sync: first pts is %"PRId64, cur->start );
cur->start = 0;
}
}
if ( pv->first_drop )
{
hb_log( "sync: video time didn't advance - dropped %d frames "
- "(delta %d ms, current %lld, next %lld, dur %d)",
+ "(delta %d ms, current %"PRId64", next %"PRId64", dur %d)",
pv->drop_count, (int)( cur->start - pv->first_drop ) / 90,
cur->start, next->start, (int)( next->start - cur->start ) );
pv->first_drop = 0;
pts_skip = 0;
if ( duration <= 0 )
{
- hb_log( "sync: invalid video duration %lld, start %lld, next %lld",
+ hb_log( "sync: invalid video duration %"PRId64", start %"PRId64", next %"PRId64"",
duration, buf_tmp->start, next->start );
}
{
// we were dropping old data but input buf time is now current
hb_log( "sync: audio %d time went backwards %d ms, dropped %d frames "
- "(next %lld, current %lld)", i,
+ "(next %"PRId64", current %"PRId64")", i,
(int)( sync->next_pts - sync->first_drop ) / 90,
sync->drop_count, sync->first_drop, sync->next_pts );
sync->first_drop = 0;
// frame and this. assume we got a corrupted timestamp
// and just drop the next buf.
hb_log( "sync: %d minute time gap in audio %d - dropping buf"
- " start %lld, next %lld",
+ " start %"PRId64", next %"PRId64,
(int)((start - sync->next_pts) / (90000*60)),
i, start, sync->next_pts );
buf = hb_fifo_get( audio->priv.fifo_raw );
if( sync->audio->config.out.codec == HB_ACODEC_DCA )
{
hb_log( "sync: audio gap %d ms. Skipping frames. Audio %d"
- " start %lld, next %lld",
+ " start %"PRId64", next %"PRId64,
(int)((start - sync->next_pts) / 90),
i, start, sync->next_pts );
pv->audio_passthru_slip += (start - sync->next_pts);
return;
}
hb_log( "sync: adding %d ms of silence to audio %d"
- " start %lld, next %lld",
+ " start %"PRId64", next %"PRId64,
(int)((start - sync->next_pts) / 90),
i, start, sync->next_pts );
InsertSilence( w, i, start - sync->next_pts );