From b5223402d16775577e2b462a724902b69e90acaa Mon Sep 17 00:00:00 2001 From: kidjan Date: Sun, 20 May 2012 20:41:37 +0000 Subject: [PATCH] Remove some really old #if 0 code; most of it hasn't been touched in years. Not of any value anymore. --- include/mp4v2/itmf_generic.h | 2 +- src/mp4atom.cpp | 5 +-- src/mp4file.cpp | 65 ++---------------------------------- src/mp4file_io.cpp | 20 ----------- src/mp4track.cpp | 7 ---- src/qosqualifiers.cpp | 24 ------------- src/qosqualifiers.h | 47 -------------------------- util/mp4extract.cpp | 7 ---- 8 files changed, 4 insertions(+), 173 deletions(-) diff --git a/include/mp4v2/itmf_generic.h b/include/mp4v2/itmf_generic.h index fc0ec5e..b780b1e 100644 --- a/include/mp4v2/itmf_generic.h +++ b/include/mp4v2/itmf_generic.h @@ -123,7 +123,7 @@ typedef struct MP4ItmfItem_s char* code; /**< four-char code identifing atom type. NULL-terminated. */ char* mean; /**< may be NULL. UTF-8 meaning. NULL-terminated. */ char* name; /**< may be NULL. UTF-8 name. NULL-terminated. */ - MP4ItmfDataList dataList; /**< list of data. size is always >= 1. */ + MP4ItmfDataList dataList; /**< list of data. can be zero length. */ } MP4ItmfItem; /** List of items. */ diff --git a/src/mp4atom.cpp b/src/mp4atom.cpp index e262be9..520cbc8 100644 --- a/src/mp4atom.cpp +++ b/src/mp4atom.cpp @@ -160,12 +160,9 @@ MP4Atom* MP4Atom::ReadAtom(MP4File& file, MP4Atom* pParentAtom) hdrSize, dataSize, pos + hdrSize + dataSize); -#if 0 - throw new Exception("invalid atom size", __FILE__, __LINE__, __FUNCTION__); -#else + // skip to end of atom dataSize = pParentAtom->GetEnd() - pos - hdrSize; -#endif } MP4Atom* pAtom = CreateAtom(file, pParentAtom, type); diff --git a/src/mp4file.cpp b/src/mp4file.cpp index cdab917..25e241f 100644 --- a/src/mp4file.cpp +++ b/src/mp4file.cpp @@ -984,23 +984,9 @@ void MP4File::AddTrackToIod(MP4TrackId trackId) void MP4File::RemoveTrackFromIod(MP4TrackId trackId, bool shallHaveIods) { MP4DescriptorProperty* pDescriptorProperty = NULL; - if (!m_pRootAtom->FindProperty("moov.iods.esIds", - (MP4Property**)&pDescriptorProperty)) + if (!m_pRootAtom->FindProperty("moov.iods.esIds",(MP4Property**)&pDescriptorProperty) + || pDescriptorProperty == NULL) return; -#if 0 - // we may not have iods - if (shallHaveIods) { - ASSERT(pDescriptorProperty); - } else { - if (!pDescriptorProperty) { - return; - } - } -#else - if (pDescriptorProperty == NULL) { - return; - } -#endif for (uint32_t i = 0; i < pDescriptorProperty->GetCount(); i++) { /* static */ @@ -1159,13 +1145,7 @@ MP4TrackId MP4File::AddSystemsTrack(const char* type, uint32_t timeScale) SetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsd.mp4s.esds.ESID", -#if 0 - // note - for a file, these values need to - // be 0 - wmay - 04/16/2003 - trackId -#else 0 -#endif ); SetTrackIntegerProperty(trackId, @@ -1415,13 +1395,7 @@ MP4TrackId MP4File::AddAudioTrack( SetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsd.mp4a.esds.ESID", -#if 0 - // note - for a file, these values need to - // be 0 - wmay - 04/16/2003 - trackId -#else 0 -#endif ); SetTrackIntegerProperty(trackId, @@ -1599,11 +1573,6 @@ MP4TrackId MP4File::AddEncAudioTrack(uint32_t timeScale, SetTrackStringProperty(trackId, "mdia.minf.stbl.stsd.enca.sinf.schi.iKMS.kms_URI", kms_uri); -#if 0 - if (kms_uri != NULL) { - free((void *)kms_uri); - } -#endif SetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsd.enca.sinf.schi.iSFM.selective-encryption", @@ -1624,13 +1593,7 @@ MP4TrackId MP4File::AddEncAudioTrack(uint32_t timeScale, SetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsd.enca.esds.ESID", -#if 0 - // note - for a file, these values need to - // be 0 - wmay - 04/16/2003 - trackId -#else 0 -#endif ); SetTrackIntegerProperty(trackId, @@ -1743,13 +1706,7 @@ MP4TrackId MP4File::AddMP4VideoTrack( SetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsd.mp4v.esds.ESID", -#if 0 - // note - for a file, these values need to - // be 0 - wmay - 04/16/2003 - trackId -#else 0 -#endif ); SetTrackIntegerProperty(trackId, @@ -1827,21 +1784,9 @@ MP4TrackId MP4File::AddEncVideoTrack(uint32_t timeScale, "mdia.minf.stbl.stsd.encv.sinf.schi.iSFM.IV-length", icPp->iv_len); -#if 0 - if (icPp->kms_uri != NULL) { - free(icPp->kms_uri); - } -#endif - SetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsd.encv.esds.ESID", -#if 0 - // note - for a file, these values need to - // be 0 - wmay - 04/16/2003 - trackId -#else 0 -#endif ); SetTrackIntegerProperty(trackId, @@ -2262,13 +2207,7 @@ MP4TrackId MP4File::AddSubpicTrack(uint32_t timescale, SetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsd.mp4s.esds.ESID", -#if 0 - // note - for a file, these values need to - // be 0 - wmay - 04/16/2003 - trackId -#else 0 -#endif ); SetTrackIntegerProperty(trackId, diff --git a/src/mp4file_io.cpp b/src/mp4file_io.cpp index 9da4843..5de2910 100644 --- a/src/mp4file_io.cpp +++ b/src/mp4file_io.cpp @@ -184,26 +184,6 @@ uint64_t MP4File::ReadUInt(uint8_t size) } } -#if 0 -void MP4File::WriteUInt(uint64_t value, uint8_t size) -{ - switch (size) { - case 1: - WriteUInt8(value); - case 2: - WriteUInt16(value); - case 3: - WriteUInt24(value); - case 4: - WriteUInt32(value); - case 8: - WriteUInt64(value); - default: - ASSERT(false); - } -} -#endif - uint8_t MP4File::ReadUInt8() { uint8_t data; diff --git a/src/mp4track.cpp b/src/mp4track.cpp index 1346a5b..cfa1a1f 100644 --- a/src/mp4track.cpp +++ b/src/mp4track.cpp @@ -787,13 +787,6 @@ void MP4Track::UpdateSampleSizes(MP4SampleId sampleId, uint32_t numBytes) } // either way, we increment the number of samples. m_pStszSampleCountProperty->IncrementValue(); -#if 0 - printf("track %u sample id %u bytes %u fixed %u count %u prop %u\n", - m_trackId, sampleId, numBytes, - m_pStszFixedSampleSizeProperty->GetValue(), - m_pStszSampleSizeProperty->GetCount(), - m_pStszSampleCountProperty->GetValue()); -#endif } uint32_t MP4Track::GetAvgBitrate() diff --git a/src/qosqualifiers.cpp b/src/qosqualifiers.cpp index 2ba9dd5..02d54c1 100644 --- a/src/qosqualifiers.cpp +++ b/src/qosqualifiers.cpp @@ -151,29 +151,6 @@ MP4Descriptor* MP4QosQualifierProperty::CreateDescriptor(MP4Atom &parentAtom, ui { MP4Descriptor* pDescriptor = NULL; switch (tag) { -#if 0 - case MP4MaxDelayQosTag: - pDescriptor = new MP4MaxDelayQosQualifier(parentAtom); - break; - case MP4PrefMaxDelayQosTag: - pDescriptor = new MP4PrefMaxDelayQosQualifier(parentAtom); - break; - case MP4LossProbQosTag: - pDescriptor = new MP4LossProbQosQualifier(parentAtom); - break; - case MP4MaxGapLossQosTag: - pDescriptor = new MP4MaxGapLossQosQualifier(parentAtom); - break; - case MP4MaxAUSizeQosTag: - pDescriptor = new MP4MaxAUSizeQosQualifier(parentAtom); - break; - case MP4AvgAUSizeQosTag: - pDescriptor = new MP4AvgAUSizeQosQualifier(parentAtom); - break; - case MP4MaxAURateQosTag: - pDescriptor = new MP4MaxAURateQosQualifier(parentAtom); - break; -#else case MP4MaxDelayQosTag: case MP4PrefMaxDelayQosTag: case MP4LossProbQosTag: @@ -183,7 +160,6 @@ MP4Descriptor* MP4QosQualifierProperty::CreateDescriptor(MP4Atom &parentAtom, ui case MP4MaxAURateQosTag: pDescriptor = new MP4QosDescriptorBase(parentAtom, tag); break; -#endif default: pDescriptor = new MP4UnknownQosQualifier(parentAtom); pDescriptor->SetTag(tag); diff --git a/src/qosqualifiers.h b/src/qosqualifiers.h index 9e3a59e..5bd4bd0 100644 --- a/src/qosqualifiers.h +++ b/src/qosqualifiers.h @@ -28,16 +28,6 @@ namespace impl { /////////////////////////////////////////////////////////////////////////////// const uint8_t MP4QosDescrTag = 0x0C; - -#if 0 -class MP4QosDescriptor : public MP4Descriptor { -public: - MP4QosDescriptor(MP4Atom &parentAtom); -}; - -typedef MP4Descriptor MP4QosQualifier; -#endif - const uint8_t MP4QosTagsStart = 0x01; const uint8_t MP4MaxDelayQosTag = 0x01; const uint8_t MP4PrefMaxDelayQosTag = 0x02; @@ -48,42 +38,6 @@ const uint8_t MP4AvgAUSizeQosTag = 0x42; const uint8_t MP4MaxAURateQosTag = 0x43; const uint8_t MP4QosTagsEnd = 0xFF; -#if 0 -class MP4MaxDelayQosQualifier : public MP4QosQualifier { -public: - MP4MaxDelayQosQualifier(MP4Atom &parentAtom); -}; - -class MP4PrefMaxDelayQosQualifier : public MP4QosQualifier { -public: - MP4PrefMaxDelayQosQualifier(MP4Atom &parentAtom); -}; - -class MP4LossProbQosQualifier : public MP4QosQualifier { -public: - MP4LossProbQosQualifier(MP4Atom &parentAtom); -}; - -class MP4MaxGapLossQosQualifier : public MP4QosQualifier { -public: - MP4MaxGapLossQosQualifier(MP4Atom &parentAtom); -}; - -class MP4MaxAUSizeQosQualifier : public MP4QosQualifier { -public: - MP4MaxAUSizeQosQualifier(MP4Atom &parentAtom); -}; - -class MP4AvgAUSizeQosQualifier : public MP4QosQualifier { -public: - MP4AvgAUSizeQosQualifier(MP4Atom &parentAtom); -}; - -class MP4MaxAURateQosQualifier : public MP4QosQualifier { -public: - MP4MaxAURateQosQualifier(MP4Atom &parentAtom); -}; -#else class MP4QosDescriptorBase : public MP4Descriptor { public: MP4QosDescriptorBase(MP4Atom &parentAtom, uint8_t tag); @@ -93,7 +47,6 @@ class MP4QosDescriptorBase : public MP4Descriptor { MP4QosDescriptorBase &operator= ( const MP4QosDescriptorBase &src ); }; -#endif class MP4UnknownQosQualifier : public MP4Descriptor { public: MP4UnknownQosQualifier(MP4Atom &parentAtom); diff --git a/util/mp4extract.cpp b/util/mp4extract.cpp index 49eb2ed..1e3c232 100644 --- a/util/mp4extract.cpp +++ b/util/mp4extract.cpp @@ -47,13 +47,6 @@ extern "C" int main( int argc, char** argv ) char* dstFileName = NULL; MP4LogLevel verbosity = MP4_LOG_ERROR; -#if 0 - fprintf( stderr, "You don't want to use this utility - use mp4creator --extract instead\n" ); - fprintf( stderr, "If you really want to use it, remove this warning and the exit call\n" ); - fprintf( stderr, "from the source file\n" ); - exit( -1 ); -#endif - /* begin processing command line */ ProgName = argv[0]; while ( true ) {