Skip to content

Commit

Permalink
Remove some really old #if 0 code; most of it hasn't been touched in …
Browse files Browse the repository at this point in the history
…years. Not of any value anymore.
  • Loading branch information
kidjan committed May 20, 2012
1 parent 0d3f556 commit b522340
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 173 deletions.
2 changes: 1 addition & 1 deletion include/mp4v2/itmf_generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
5 changes: 1 addition & 4 deletions src/mp4atom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
65 changes: 2 additions & 63 deletions src/mp4file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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",
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
20 changes: 0 additions & 20 deletions src/mp4file_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 0 additions & 7 deletions src/mp4track.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
24 changes: 0 additions & 24 deletions src/qosqualifiers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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);
Expand Down
47 changes: 0 additions & 47 deletions src/qosqualifiers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand All @@ -93,7 +47,6 @@ class MP4QosDescriptorBase : public MP4Descriptor {
MP4QosDescriptorBase &operator= ( const MP4QosDescriptorBase &src );
};

#endif
class MP4UnknownQosQualifier : public MP4Descriptor {
public:
MP4UnknownQosQualifier(MP4Atom &parentAtom);
Expand Down
7 changes: 0 additions & 7 deletions util/mp4extract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down

0 comments on commit b522340

Please sign in to comment.