if ( title->height == 0 || title->width == 0 || title->aspect == 0 )
{
hb_log( "hb_fix_aspect: incomplete info for title %d: "
- "height = %d, width = %d, aspect = %d",
- title->height, title->width, title->aspect );
+ "height = %d, width = %d, aspect = %.3f",
+ title->index, title->height, title->width, title->aspect );
return;
}
#include <sys/stat.h>
#include <dirent.h>
+#if defined( __GNUC__ ) && !(defined( _WIN32 ) || defined( __MINGW32__ ))
+# define HB_WPRINTF(s,v) __attribute__((format(printf,s,v)))
+#else
+# define HB_WPRINTF(s,v)
+#endif
+
#if defined( SYS_MINGW )
# define fseek fseeko64
# define ftell ftello64
hb_error( "Invalid shift sequence" );
} else if ( ( retval == -1 ) && ( errno == EILSEQ ) )
{
- hb_error( "Invalid byte for codeset in input, %d bytes discarded",
- in_size);
+ hb_error( "Invalid byte for codeset in input, %"PRId64" bytes discarded", (int64_t)in_size);
} else if ( ( retval == -1 ) && ( errno == E2BIG ) )
{
hb_error( "Not enough space in output buffer");
pgn = vts->vts_ptt_srpt->title[title->ttn-1].ptt[0].pgn;
d->pgc = vts->vts_pgcit->pgci_srp[pgc_id-1].pgc;
- hb_log("pgc_id: %d, pgn: %d: pgc: 0x%x", pgc_id, pgn, d->pgc);
+ hb_log("pgc_id: %d, pgn: %d: pgc: %p", pgc_id, pgn, d->pgc);
if( !d->pgc )
{
pgc = ifo->vts_pgcit->pgci_srp[pgcn-1].pgc;
- hb_log("pgc_id: %d, pgn: %d: pgc: 0x%x", pgcn, pgn, pgc);
+ hb_log("pgc_id: %d, pgn: %d: pgc: %p", pgcn, pgn, pgc);
if (pgn > pgc->nr_of_programs)
{
hb_error( "invalid PGN %d for title %d, skipping", pgn, t );
/***********************************************************************
* common.c
**********************************************************************/
-void hb_log( char * log, ... );
+void hb_log( char * log, ... ) HB_WPRINTF(1,2);
extern int global_verbosity_level; // Global variable for hb_deep_log
typedef enum hb_debug_level_s
{
HB_HOUSEKEEPING_LOG = 2, // stuff we hate scrolling through
HB_GRANULAR_LOG = 3 // sample-by-sample
} hb_debug_level_t;
-void hb_deep_log( hb_debug_level_t level, char * log, ... );
-void hb_error( char * fmt, ...);
+void hb_deep_log( hb_debug_level_t level, char * log, ... ) HB_WPRINTF(2,3);
+void hb_error( char * fmt, ...) HB_WPRINTF(1,2);
int hb_list_bytes( hb_list_t * );
void hb_list_seebytes( hb_list_t * l, uint8_t * dst, int size );
{
/* Video */
hb_deep_log( 2, "mux: video bitrate error, %+lld bytes",
- track->bytes - mux->pts * job->vbitrate *
- 125 / 90000 );
+ (int64_t)(track->bytes - mux->pts * job->vbitrate * 125 / 90000) );
}
bytes_total += track->bytes;
frames_total += track->frames;
err = AudioConverterNew( &input, &output, &pv->converter );
if( err != noErr)
{
- hb_log( "Error creating an AudioConverter %x %d", err, output.mBytesPerFrame );
+ hb_log( "Error creating an AudioConverter err=%"PRId64" %"PRIu64, (int64_t)err, (uint64_t)output.mBytesPerFrame );
*job->die = 1;
return 0;
}
#include <netinet/in.h>
#endif
+#include <stddef.h>
+
#include "hb.h"
/************************************************************************
#endif
};
+/* Get a unique identifier to thread and represent as 64-bit unsigned.
+ * If unsupported, the value 0 is be returned.
+ * Caller should use result only for display/log purposes.
+ */
+static uint64_t hb_thread_to_integer( const hb_thread_t* t )
+{
+#if defined( USE_PTHREAD )
+ #if defined( _WIN32 ) || defined( __MINGW32__ )
+ return (uint64_t)(ptrdiff_t)t->thread.p;
+ #elif defined( SYS_DARWIN )
+ return (uint64_t)(ptrdiff_t)t->thread;
+ #else
+ return (uint64_t)t->thread;
+ #endif
+#else
+ return 0;
+#endif
+}
+
/************************************************************************
* hb_thread_func()
************************************************************************
t->function( t->arg );
/* Inform that the thread can be joined now */
- hb_deep_log( 2, "thread %x exited (\"%s\")", t->thread, t->name );
+ hb_deep_log( 2, "thread %"PRIx64" exited (\"%s\")", hb_thread_to_integer( t ), t->name );
hb_lock( t->lock );
t->exited = 1;
hb_unlock( t->lock );
// SetThreadPriority( GetCurrentThread(), THREAD_PRIORITY_BELOW_NORMAL );
#endif
- hb_deep_log( 2, "thread %x started (\"%s\")", t->thread, t->name );
+ hb_deep_log( 2, "thread %"PRIx64" started (\"%s\")", hb_thread_to_integer( t ), t->name );
return t;
}
// WaitForSingleObject( t->thread, INFINITE );
#endif
- hb_deep_log( 2, "thread %x joined (\"%s\")",
- t->thread, t->name );
+ hb_deep_log( 2, "thread %"PRIx64" joined (\"%s\")", hb_thread_to_integer( t ), t->name );
hb_lock_close( &t->lock );
free( t->name );