Lines Matching defs:mxg
45 MXGContext *mxg = s->priv_data;
67 mxg->soi_ptr = mxg->buffer_ptr = mxg->buffer = 0;
68 mxg->buffer_size = 0;
69 mxg->dts = AV_NOPTS_VALUE;
70 mxg->cache_size = 0;
102 MXGContext *mxg = s->priv_data;
103 unsigned int current_pos = mxg->buffer_ptr - mxg->buffer;
111 soi_pos = mxg->soi_ptr - mxg->buffer;
112 buffer = av_fast_realloc(mxg->buffer, &mxg->buffer_size,
117 mxg->buffer = buffer;
118 mxg->buffer_ptr = mxg->buffer + current_pos;
119 if (mxg->soi_ptr) mxg->soi_ptr = mxg->buffer + soi_pos;
122 ret = avio_read(s->pb, mxg->buffer_ptr + mxg->cache_size,
123 cache_size - mxg->cache_size);
127 mxg->cache_size += ret;
137 MXGContext *mxg = s->priv_data;
140 if (mxg->cache_size <= OVERREAD_SIZE) {
146 end = mxg->buffer_ptr + mxg->cache_size;
149 if (mxg->cache_size > OVERREAD_SIZE) {
151 startmarker_ptr = mxg_find_startmarker(mxg->buffer_ptr, search_end);
154 startmarker_ptr = mxg_find_startmarker(mxg->buffer_ptr, search_end);
161 mxg->buffer_ptr = startmarker_ptr + 2;
162 mxg->cache_size = end - mxg->buffer_ptr;
165 mxg->soi_ptr = startmarker_ptr;
167 if (!mxg->soi_ptr) {
172 pkt->pts = pkt->dts = mxg->dts;
180 pkt->size = mxg->buffer_ptr - mxg->soi_ptr;
181 pkt->data = mxg->soi_ptr;
183 if (mxg->soi_ptr - mxg->buffer > mxg->cache_size) {
184 if (mxg->cache_size > 0) {
185 memcpy(mxg->buffer, mxg->buffer_ptr, mxg->cache_size);
188 mxg->buffer_ptr = mxg->buffer;
190 mxg->soi_ptr = 0;
197 size = AV_RB16(mxg->buffer_ptr);
201 if (mxg->cache_size < size) {
205 startmarker_ptr = mxg->buffer_ptr - 2;
206 mxg->cache_size = 0;
208 mxg->cache_size -= size;
211 mxg->buffer_ptr += size;
226 if (startmarker_ptr - mxg->buffer > mxg->cache_size) {
227 if (mxg->cache_size > 0) {
228 memcpy(mxg->buffer, mxg->buffer_ptr, mxg->cache_size);
230 mxg->buffer_ptr = mxg->buffer;
237 mxg->dts = AV_RL64(startmarker_ptr + 12);
242 mxg->buffer_ptr = search_end;
243 mxg->cache_size = OVERREAD_SIZE;
252 MXGContext *mxg = s->priv_data;
253 av_freep(&mxg->buffer);
258 .name = "mxg",
264 .extensions = "mxg",