~ubuntu-branches/ubuntu/oneiric/libmatroska/oneiric

« back to all changes in this revision

Viewing changes to src/KaxBlockData.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Julien Lavergne
  • Date: 2011-02-21 01:33:10 UTC
  • mfrom: (1.2.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20110221013310-9u59rolgy6s4n0yq
Tags: 1.1.0+dfsg-0ubuntu1
* New upstream release (LP: #722382)
* debian/source/format & debian/rules:
 - Convert to source format 3.0.
* debian/control:
 - Remove quilt build-depends.
* Bump SONAME to 3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
84
84
KaxReferenceBlock::KaxReferenceBlock(const KaxReferenceBlock & ElementToClone)
85
85
:EbmlSInteger(ElementToClone)
86
86
,bTimecodeSet(ElementToClone.bTimecodeSet)
87
 
{
 
87
,bOurBlob(false)
 
88
{
 
89
}
 
90
 
 
91
KaxReferenceBlock::~KaxReferenceBlock()
 
92
{
 
93
    FreeBlob();
 
94
}
 
95
 
 
96
void KaxReferenceBlock::FreeBlob()
 
97
{
 
98
    if (bOurBlob && RefdBlock!=NULL)
 
99
        delete RefdBlock;
 
100
    RefdBlock = NULL;
88
101
}
89
102
 
90
103
filepos_t KaxReferenceBlock::UpdateSize(bool bSaveDefault, bool bForceRender)
103
116
{
104
117
        assert(RefdBlock == NULL);
105
118
        assert(aRefdBlock != NULL);
 
119
    FreeBlob();
106
120
        RefdBlock = aRefdBlock; 
 
121
    bOurBlob = true;
107
122
        SetValueIsSet();
108
123
}
109
124
 
110
125
void KaxReferenceBlock::SetReferencedBlock(const KaxBlockGroup & aRefdBlock)
111
126
{
 
127
    FreeBlob();
112
128
        KaxBlockBlob *block_blob = new KaxBlockBlob(BLOCK_BLOB_NO_SIMPLE);
113
129
        block_blob->SetBlockGroup(*const_cast<KaxBlockGroup*>(&aRefdBlock));
114
 
        RefdBlock = block_blob; 
 
130
        RefdBlock = block_blob;
 
131
    bOurBlob = true;
115
132
        SetValueIsSet();
116
133
}
117
134