~ubuntu-branches/ubuntu/raring/gpac/raring

« back to all changes in this revision

Viewing changes to modules/isom_in/read_ch.c

  • Committer: Bazaar Package Importer
  • Author(s): John Dong
  • Date: 2007-01-24 23:34:57 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070124233457-zzlls8afkt0nyakj
Tags: 0.4.2~rc2-0ubuntu1
* New upstream release
  * Most notably MP4 tagging support via MP4Box -itags
* debian/patches/01_64bits.dpatch: dropped; included upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
void isor_reset_reader(ISOMChannel *ch)
30
30
{
31
 
        memset(&ch->current_slh, 0, sizeof(SLHeader));
 
31
        memset(&ch->current_slh, 0, sizeof(GF_SLHeader));
32
32
        ch->last_state = GF_OK;
33
33
        if (ch->sample) gf_isom_sample_del(&ch->sample);
34
34
        ch->sample = NULL;
54
54
 
55
55
        assert(ch->sample==NULL);
56
56
 
57
 
        if (ch->is_ocr) {
 
57
        if (ch->streamType==GF_STREAM_OCR) {
58
58
                assert(!ch->sample);
59
59
                ch->sample = gf_isom_sample_new();
60
60
                ch->sample->IsRAP = 1;
99
99
        u32 ivar;
100
100
        if (ch->sample) return;
101
101
 
102
 
        /*that's our fake OD stream*/
103
 
        if (ch->FAKE_ESID) {
104
 
                ch->current_slh.accessUnitEndFlag = 1;
105
 
                ch->current_slh.accessUnitStartFlag = 1;
106
 
                ch->current_slh.AU_sequenceNumber = 1;
107
 
                ch->current_slh.compositionTimeStampFlag = 1;
108
 
                ch->current_slh.decodingTimeStampFlag = 1;
109
 
                ch->current_slh.packetSequenceNumber = 1;
110
 
                ch->current_slh.randomAccessPointFlag = 0;
111
 
                if (ch->last_state == GF_EOS) return;
112
 
 
113
 
                ch->sample = gf_isom_sample_new();
114
 
                ch->sample->dataLength = ch->owner->od_au_size;
115
 
                ch->sample->data = ch->owner->od_au;
116
 
                ch->sample->IsRAP = 1;
117
 
                ch->current_slh.decodingTimeStamp = ch->start;
118
 
                ch->current_slh.compositionTimeStamp = ch->start;
119
 
                return;
120
 
        }
121
 
 
122
102
        if (ch->to_init) {
123
103
                init_reader(ch);
124
104
        } else if (ch->has_edit_list) {
125
105
                e = gf_isom_get_sample_for_movie_time(ch->owner->mov, ch->track, ch->sample_time + 1, &ivar, GF_ISOM_SEARCH_FORWARD, &ch->sample, &ch->sample_num);
126
106
                if (ch->sample) ch->sample_time = ch->sample->DTS;
127
107
        } else {
 
108
fetch_next:
128
109
                ch->sample = gf_isom_get_sample(ch->owner->mov, ch->track, ch->sample_num, &ivar);
129
 
                /*if sync shadow skip*/
 
110
                /*if sync shadow / carousel RAP skip*/
130
111
                if (ch->sample && (ch->sample->IsRAP==2)) {
131
112
                        gf_isom_sample_del(&ch->sample);
132
113
                        ch->sample_num++;
133
 
                        ch->sample = gf_isom_get_sample(ch->owner->mov, ch->track, ch->sample_num, &ivar);
 
114
                        goto fetch_next;
134
115
                }
135
116
        }
136
117
        if (!ch->sample) {
155
136
                ch->current_slh.decodingTimeStamp = ch->sample->DTS;
156
137
                ch->current_slh.compositionTimeStamp = ch->sample->DTS + ch->sample->CTS_Offset;
157
138
        } else {
158
 
                ch->current_slh.decodingTimeStamp = ch->start;
159
139
                ch->current_slh.compositionTimeStamp = ch->start;
 
140
                if (ch->streamType==GF_STREAM_SCENE)
 
141
                        ch->current_slh.decodingTimeStamp = ch->sample->DTS;
 
142
                else
 
143
                        ch->current_slh.decodingTimeStamp = ch->start;
160
144
        }
161
145
        ch->current_slh.randomAccessPointFlag = ch->sample->IsRAP;
162
146
 
179
163
 
180
164
void isor_reader_release_sample(ISOMChannel *ch)
181
165
{
182
 
 
183
 
        if (ch->FAKE_ESID) {
184
 
                /*DON'T DESTROY OD, it will be needed for later seek...*/
185
 
                ch->last_state = GF_EOS;
186
 
                ch->sample->data = NULL;
187
 
                ch->sample->dataLength = 0;
188
 
        }
189
166
        /*this is to handle edit list*/
190
167
        if (ch->sample->data) ch->sample_num++;
191
168