diff --git a/ChangeLog b/ChangeLog index 34c88b6d..1b930333 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24771,3 +24771,7 @@ method. 2024-05-19 Fred Gleason * Added a 'Debian 12 "Bookworm"' section to the 'INSTALL' file. +2024-05-25 Fred Gleason + * Added an 'RDWaveData::dump()' static method. + * Fixed a regression in the audio importation system that could + cause the detected length of an MPEG file to be '0'. diff --git a/lib/rdcut.cpp b/lib/rdcut.cpp index 236f1a9b..c13a0f1c 100644 --- a/lib/rdcut.cpp +++ b/lib/rdcut.cpp @@ -1120,7 +1120,12 @@ void RDCut::setMetadata(RDWaveData *data) const sql+=QString::asprintf("`START_POINT`=%d,",data->startPos()); } if(data->endPos()>=0) { - sql+=QString::asprintf("`END_POINT`=%d,",data->endPos()); + if(data->endPos()>length()) { + sql+=QString::asprintf("`END_POINT`=%d,",length()); + } + else { + sql+=QString::asprintf("`END_POINT`=%d,",data->endPos()); + } } if((data->talkStartPos()==data->startPos())&& (data->talkEndPos()==data->endPos())) { diff --git a/lib/rdwavedata.cpp b/lib/rdwavedata.cpp index fe23aa67..6e660c8a 100644 --- a/lib/rdwavedata.cpp +++ b/lib/rdwavedata.cpp @@ -2,7 +2,7 @@ // // A Container Class for Audio Meta Data. // -// (C) Copyright 2002-2021 Fred Gleason +// (C) Copyright 2002-2024 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU Library General Public License @@ -1432,3 +1432,18 @@ QString RDWaveData::usageText(UsageCode code) return ret; } + + +QString RDWaveData::dump(const QString &label,RDWaveData *data) +{ + QString ret=label+": "; + + if(data==NULL) { + ret+="[NULL]"; + } + else { + ret+=data->dump(); + } + + return ret; +} diff --git a/lib/rdwavedata.h b/lib/rdwavedata.h index 9701673b..b27cdeed 100644 --- a/lib/rdwavedata.h +++ b/lib/rdwavedata.h @@ -2,7 +2,7 @@ // // A Container Class for Audio Meta Data. // -// (C) Copyright 2002-2020 Fred Gleason +// (C) Copyright 2002-2024 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU Library General Public License @@ -202,6 +202,7 @@ class RDWaveData static QString endTypeText(EndType type); static QString cartTypeText(CartType type); static QString usageText(UsageCode code); + static QString dump(const QString &label,RDWaveData *data); private: bool data_metadata_found; diff --git a/lib/rdwavefile.cpp b/lib/rdwavefile.cpp index e1e1cbf2..80719619 100644 --- a/lib/rdwavefile.cpp +++ b/lib/rdwavefile.cpp @@ -316,6 +316,7 @@ bool RDWaveFile::openWave(RDWaveData *data) } data_start=id3v2_offset[0]; sample_length=1152*(data_length/mpeg_frame_size); + ext_time_length=1000*((uint64_t)sample_length)/((uint64_t)samples_per_sec); data_chunk=true; lseek(wave_file.handle(),data_start,SEEK_SET); format_chunk=true;