Lines Matching defs:mxg
43 MXGContext *mxg = s->priv_data;
64 mxg->soi_ptr = mxg->buffer_ptr = mxg->buffer = 0;
65 mxg->buffer_size = 0;
66 mxg->dts = AV_NOPTS_VALUE;
67 mxg->cache_size = 0;
99 MXGContext *mxg = s->priv_data;
100 unsigned int current_pos = mxg->buffer_ptr - mxg->buffer;
107 if (mxg->soi_ptr) soi_pos = mxg->soi_ptr - mxg->buffer;
108 mxg->buffer = av_fast_realloc(mxg->buffer, &mxg->buffer_size,
111 if (!mxg->buffer)
113 mxg->buffer_ptr = mxg->buffer + current_pos;
114 if (mxg->soi_ptr) mxg->soi_ptr = mxg->buffer + soi_pos;
117 ret = avio_read(s->pb, mxg->buffer_ptr + mxg->cache_size,
118 cache_size - mxg->cache_size);
122 mxg->cache_size += ret;
132 MXGContext *mxg = s->priv_data;
135 if (mxg->cache_size <= OVERREAD_SIZE) {
141 end = mxg->buffer_ptr + mxg->cache_size;
144 if (mxg->cache_size > OVERREAD_SIZE) {
146 startmarker_ptr = mxg_find_startmarker(mxg->buffer_ptr, search_end);
149 startmarker_ptr = mxg_find_startmarker(mxg->buffer_ptr, search_end);
156 mxg->buffer_ptr = startmarker_ptr + 2;
157 mxg->cache_size = end - mxg->buffer_ptr;
160 mxg->soi_ptr = startmarker_ptr;
162 if (!mxg->soi_ptr) {
167 pkt->pts = pkt->dts = mxg->dts;
170 pkt->size = mxg->buffer_ptr - mxg->soi_ptr;
171 pkt->data = mxg->soi_ptr;
173 if (mxg->soi_ptr - mxg->buffer > mxg->cache_size) {
174 if (mxg->cache_size > 0) {
175 memcpy(mxg->buffer, mxg->buffer_ptr, mxg->cache_size);
178 mxg->buffer_ptr = mxg->buffer;
180 mxg->soi_ptr = 0;
187 size = AV_RB16(mxg->buffer_ptr);
191 if (mxg->cache_size < size) {
195 startmarker_ptr = mxg->buffer_ptr - 2;
196 mxg->cache_size = 0;
198 mxg->cache_size -= size;
201 mxg->buffer_ptr += size;
211 if (startmarker_ptr - mxg->buffer > mxg->cache_size) {
212 if (mxg->cache_size > 0) {
213 memcpy(mxg->buffer, mxg->buffer_ptr, mxg->cache_size);
215 mxg->buffer_ptr = mxg->buffer;
222 mxg->dts = AV_RL64(startmarker_ptr + 12);
227 mxg->buffer_ptr = search_end;
228 mxg->cache_size = OVERREAD_SIZE;
237 MXGContext *mxg = s->priv_data;
238 av_freep(&mxg->buffer);
243 .name = "mxg",
249 .extensions = "mxg"