ffmpegdec.cpp: Fix format specifiers for time_t for platform compatibility

- Use PRId64 in printf to format time_t variables correctly.
- Cast time_t variables to int64_t to avoid [-Wformat=] warnings.
This commit is contained in:
2024-07-04 16:08:36 +02:00
parent 553375d8aa
commit caf762464b

View File

@@ -573,7 +573,7 @@ bool CFfmpegDec::SetMetaData(FILE *_in, CAudioMetaData* m, bool save_cover)
if (avc->duration != int64_t(AV_NOPTS_VALUE)) if (avc->duration != int64_t(AV_NOPTS_VALUE))
total_time = avc->duration / int64_t(AV_TIME_BASE); total_time = avc->duration / int64_t(AV_TIME_BASE);
printf("CFfmpegDec: format %s (%s) duration %ld\n", avc->iformat->name, type_info.c_str(), total_time); printf("CFfmpegDec: format %s (%s) duration %" PRId64 "\n", avc->iformat->name, type_info.c_str(), static_cast<int64_t>(total_time));
for(unsigned int i = 0; i < avc->nb_streams; i++) { for(unsigned int i = 0; i < avc->nb_streams; i++) {
#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(57, 25, 101) #if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(57, 25, 101)