History

lavf: move internal fields from public to internal context

This is not an API change; the fields were explicitly declared private before.

wm4 committed 11 years ago

Commit 9deaec71 parent 1509c0115 files · +122 −128Browse files

Unified · Split

15 files
  1. libavformat/asfdec.c +5 −5
  2. libavformat/avformat.h +0 −49
  3. libavformat/dv.c +2 −2
  4. libavformat/internal.h +41 −0
  5. libavformat/mtv.c +1 −1
  6. libavformat/mux.c +15 −15
  7. libavformat/mxfenc.c +7 −7
  8. libavformat/nutdec.c +1 −1
  9. libavformat/oggdec.c +3 −3
  10. libavformat/options.c +1 −1
  11. libavformat/pcm.c +2 −1
  12. libavformat/r3d.c +3 −3
  13. libavformat/utils.c +39 −38
  14. libavformat/vqf.c +1 −1
  15. libavformat/yop.c +1 −1
libavformat/asfdec.c+5−5
@@ -878,7 +878,7 @@ static int asf_get_packet(AVFormatContext *s, AVIOContext *pb) · 877 unmodified lines
878878 if (asf->no_resync_search)
879879 off = 3;
880880 else if (s->packet_size > 0)
881− off = (avio_tell(pb) - s->data_offset) % s->packet_size + 3;
881+ off = (avio_tell(pb) - s->internal->data_offset) % s->packet_size + 3;
882882
883883 c = d = e = -1;
884884 while (off-- > 0) {
@@ -1361,9 +1361,9 @@ static int64_t asf_read_pts(AVFormatContext *s, int stream_index, · 476 unmodified lines
13611361 start_pos[i] = pos;
13621362
13631363 if (s->packet_size > 0)
1364− pos = (pos + s->packet_size - 1 - s->data_offset) /
1364+ pos = (pos + s->packet_size - 1 - s->internal->data_offset) /
13651365 s->packet_size * s->packet_size +
1366− s->data_offset;
1366+ s->internal->data_offset;
13671367 *ppos = pos;
13681368 avio_seek(s->pb, pos, SEEK_SET);
13691369
@@ -1437,7 +1437,7 @@ static int asf_build_simple_index(AVFormatContext *s, int stream_index) · 67 unmodified lines
14371437 for (i = 0; i < ict; i++) {
14381438 int pktnum = avio_rl32(s->pb);
14391439 int pktct = avio_rl16(s->pb);
1440− int64_t pos = s->data_offset + s->packet_size * (int64_t)pktnum;
1440+ int64_t pos = s->internal->data_offset + s->packet_size * (int64_t)pktnum;
14411441 int64_t index_pts = FFMAX(av_rescale(itime, i, 10000) - asf->hdr.preroll, 0);
14421442
14431443 if (pos != last_pos) {
@@ -1480,7 +1480,7 @@ static int asf_read_seek(AVFormatContext *s, int stream_index, · 36 unmodified lines
14801480 /* explicitly handle the case of seeking to 0 */
14811481 if (!pts) {
14821482 asf_reset_header(s);
1483− avio_seek(s->pb, s->data_offset, SEEK_SET);
1483+ avio_seek(s->pb, s->internal->data_offset, SEEK_SET);
14841484 return 0;
14851485 }
14861486
libavformat/avformat.h+0−49
@@ -1210,55 +1210,6 @@ typedef struct AVFormatContext { · 1209 unmodified lines
12101210 #define AVFMT_AVOID_NEG_TS_MAKE_NON_NEGATIVE 1 ///< Shift timestamps so they are non negative
12111211 #define AVFMT_AVOID_NEG_TS_MAKE_ZERO 2 ///< Shift timestamps so that they start at 0
12121212
1213− /*****************************************************************
1214− * All fields below this line are not part of the public API. They
1215− * may not be used outside of libavformat and can be changed and
1216− * removed at will.
1217− * New public fields should be added right above.
1218− *****************************************************************
1219− */
1220−
1221− /**
1222− * This buffer is only needed when packets were already buffered but
1223− * not decoded, for example to get the codec parameters in MPEG
1224− * streams.
1225− */
1226− struct AVPacketList *packet_buffer;
1227− struct AVPacketList *packet_buffer_end;
1228−
1229− /* av_seek_frame() support */
1230− int64_t data_offset; /**< offset of the first packet */
1231−
1232− /**
1233− * Raw packets from the demuxer, prior to parsing and decoding.
1234− * This buffer is used for buffering packets until the codec can
1235− * be identified, as parsing cannot be done without knowing the
1236− * codec.
1237− */
1238− struct AVPacketList *raw_packet_buffer;
1239− struct AVPacketList *raw_packet_buffer_end;
1240− /**
1241− * Packets split by the parser get queued here.
1242− */
1243− struct AVPacketList *parse_queue;
1244− struct AVPacketList *parse_queue_end;
1245− /**
1246− * Remaining size available for raw_packet_buffer, in bytes.
1247− */
1248−#define RAW_PACKET_BUFFER_SIZE 2500000
1249− int raw_packet_buffer_remaining_size;
1250−
1251− /**
1252− * Offset to remap timestamps to be non-negative.
1253− * Expressed in timebase units.
1254− */
1255− int64_t offset;
1256−
1257− /**
1258− * Timebase for the timestamp offset.
1259− */
1260− AVRational offset_timebase;
1261−
12621213 /**
12631214 * An opaque field for libavformat internal usage.
12641215 * Must not be accessed in any way by callers.
libavformat/dv.c+2−2
@@ -398,7 +398,7 @@ static int64_t dv_frame_offset(AVFormatContext *s, DVDemuxContext *c, · 397 unmodified lines
398398 const AVDVProfile *sys = av_dv_codec_profile(c->vst->codec->width, c->vst->codec->height,
399399 c->vst->codec->pix_fmt);
400400 int64_t offset;
401− int64_t size = avio_size(s->pb) - s->data_offset;
401+ int64_t size = avio_size(s->pb) - s->internal->data_offset;
402402 int64_t max_offset = ((size - 1) / sys->frame_size) * sys->frame_size;
403403
404404 offset = sys->frame_size * timestamp;
@@ -408,7 +408,7 @@ static int64_t dv_frame_offset(AVFormatContext *s, DVDemuxContext *c, · 3 unmodified lines
408408 else if (offset < 0)
409409 offset = 0;
410410
411− return offset + s->data_offset;
411+ return offset + s->internal->data_offset;
412412 }
413413
414414 void ff_dv_offset_reset(DVDemuxContext *c, int64_t frame_offset)
libavformat/internal.h+41−0
@@ -49,6 +49,47 @@ struct AVFormatInternal { · 48 unmodified lines
4949 * Muxing only.
5050 */
5151 int nb_interleaved_streams;
52+
53+ /**
54+ * This buffer is only needed when packets were already buffered but
55+ * not decoded, for example to get the codec parameters in MPEG
56+ * streams.
57+ */
58+ struct AVPacketList *packet_buffer;
59+ struct AVPacketList *packet_buffer_end;
60+
61+ /* av_seek_frame() support */
62+ int64_t data_offset; /**< offset of the first packet */
63+
64+ /**
65+ * Raw packets from the demuxer, prior to parsing and decoding.
66+ * This buffer is used for buffering packets until the codec can
67+ * be identified, as parsing cannot be done without knowing the
68+ * codec.
69+ */
70+ struct AVPacketList *raw_packet_buffer;
71+ struct AVPacketList *raw_packet_buffer_end;
72+ /**
73+ * Packets split by the parser get queued here.
74+ */
75+ struct AVPacketList *parse_queue;
76+ struct AVPacketList *parse_queue_end;
77+ /**
78+ * Remaining size available for raw_packet_buffer, in bytes.
79+ */
80+#define RAW_PACKET_BUFFER_SIZE 2500000
81+ int raw_packet_buffer_remaining_size;
82+
83+ /**
84+ * Offset to remap timestamps to be non-negative.
85+ * Expressed in timebase units.
86+ */
87+ int64_t offset;
88+
89+ /**
90+ * Timebase for the timestamp offset.
91+ */
92+ AVRational offset_timebase;
5293 };
5394
5495 void ff_dynarray_add(intptr_t **tab_ptr, int *nb_ptr, intptr_t elem);
libavformat/mtv.c+1−1
@@ -166,7 +166,7 @@ static int mtv_read_packet(AVFormatContext *s, AVPacket *pkt) · 165 unmodified lines
166166 AVIOContext *pb = s->pb;
167167 int ret;
168168
169− if((avio_tell(pb) - s->data_offset + mtv->img_segment_size) % mtv->full_segment_size)
169+ if((avio_tell(pb) - s->internal->data_offset + mtv->img_segment_size) % mtv->full_segment_size)
170170 {
171171 avio_skip(pb, MTV_AUDIO_PADDING_SIZE);
172172
libavformat/mux.c+15−15
@@ -329,13 +329,13 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt) · 328 unmodified lines
329329 AVRational time_base = s->streams[pkt->stream_index]->time_base;
330330 int64_t offset = 0;
331331
332− if (s->offset == AV_NOPTS_VALUE && pkt->dts != AV_NOPTS_VALUE &&
332+ if (s->internal->offset == AV_NOPTS_VALUE && pkt->dts != AV_NOPTS_VALUE &&
333333 (pkt->dts < 0 || s->avoid_negative_ts == AVFMT_AVOID_NEG_TS_MAKE_ZERO)) {
334− s->offset = -pkt->dts;
335− s->offset_timebase = time_base;
334+ s->internal->offset = -pkt->dts;
335+ s->internal->offset_timebase = time_base;
336336 }
337− if (s->offset != AV_NOPTS_VALUE)
338− offset = av_rescale_q(s->offset, s->offset_timebase, time_base);
337+ if (s->internal->offset != AV_NOPTS_VALUE)
338+ offset = av_rescale_q(s->internal->offset, s->internal->offset_timebase, time_base);
339339
340340 if (pkt->dts != AV_NOPTS_VALUE)
341341 pkt->dts += offset;
@@ -428,20 +428,20 @@ FF_ENABLE_DEPRECATION_WARNINGS · 86 unmodified lines
428428 if (s->streams[pkt->stream_index]->last_in_packet_buffer) {
429429 next_point = &(s->streams[pkt->stream_index]->last_in_packet_buffer->next);
430430 } else
431− next_point = &s->packet_buffer;
431+ next_point = &s->internal->packet_buffer;
432432
433433 if (*next_point) {
434− if (compare(s, &s->packet_buffer_end->pkt, pkt)) {
434+ if (compare(s, &s->internal->packet_buffer_end->pkt, pkt)) {
435435 while (!compare(s, &(*next_point)->pkt, pkt))
436436 next_point = &(*next_point)->next;
437437 goto next_non_null;
438438 } else {
439− next_point = &(s->packet_buffer_end->next);
439+ next_point = &(s->internal->packet_buffer_end->next);
440440 }
441441 }
442442 assert(!*next_point);
443443
444− s->packet_buffer_end = this_pktl;
444+ s->internal->packet_buffer_end = this_pktl;
445445 next_non_null:
446446
447447 this_pktl->next = *next_point;
@@ -477,8 +477,8 @@ int ff_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, · 29 unmodified lines
477477 return ret;
478478 }
479479
480− if (s->max_interleave_delta > 0 && s->packet_buffer && !flush) {
481− AVPacket *top_pkt = &s->packet_buffer->pkt;
480+ if (s->max_interleave_delta > 0 && s->internal->packet_buffer && !flush) {
481+ AVPacket *top_pkt = &s->internal->packet_buffer->pkt;
482482 int64_t delta_dts = INT64_MIN;
483483 int64_t top_dts = av_rescale_q(top_pkt->dts,
484484 s->streams[top_pkt->stream_index]->time_base,
@@ -512,12 +512,12 @@ int ff_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, · 27 unmodified lines
512512
513513
514514 if (stream_count && (s->internal->nb_interleaved_streams == stream_count || flush)) {
515− pktl = s->packet_buffer;
515+ pktl = s->internal->packet_buffer;
516516 *out = pktl->pkt;
517517
518− s->packet_buffer = pktl->next;
519− if (!s->packet_buffer)
520− s->packet_buffer_end = NULL;
518+ s->internal->packet_buffer = pktl->next;
519+ if (!s->internal->packet_buffer)
520+ s->internal->packet_buffer_end = NULL;
521521
522522 if (s->streams[out->stream_index]->last_in_packet_buffer == pktl)
523523 s->streams[out->stream_index]->last_in_packet_buffer = NULL;
libavformat/mxfenc.c+7−7
@@ -1838,7 +1838,7 @@ static int mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, AVPacket · 1837 unmodified lines
18381838 stream_count += !!s->streams[i]->last_in_packet_buffer;
18391839
18401840 if (stream_count && (s->nb_streams == stream_count || flush)) {
1841− AVPacketList *pktl = s->packet_buffer;
1841+ AVPacketList *pktl = s->internal->packet_buffer;
18421842 if (s->nb_streams != stream_count) {
18431843 AVPacketList *last = NULL;
18441844 // find last packet in edit unit
@@ -1862,20 +1862,20 @@ static int mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, AVPacket · 17 unmodified lines
18621862 if (last)
18631863 last->next = NULL;
18641864 else {
1865− s->packet_buffer = NULL;
1866− s->packet_buffer_end= NULL;
1865+ s->internal->packet_buffer = NULL;
1866+ s->internal->packet_buffer_end= NULL;
18671867 goto out;
18681868 }
1869− pktl = s->packet_buffer;
1869+ pktl = s->internal->packet_buffer;
18701870 }
18711871
18721872 *out = pktl->pkt;
18731873 av_dlog(s, "out st:%d dts:%"PRId64"\n", (*out).stream_index, (*out).dts);
1874− s->packet_buffer = pktl->next;
1874+ s->internal->packet_buffer = pktl->next;
18751875 if(s->streams[pktl->pkt.stream_index]->last_in_packet_buffer == pktl)
18761876 s->streams[pktl->pkt.stream_index]->last_in_packet_buffer= NULL;
1877− if(!s->packet_buffer)
1878− s->packet_buffer_end= NULL;
1877+ if(!s->internal->packet_buffer)
1878+ s->internal->packet_buffer_end= NULL;
18791879 av_freep(&pktl);
18801880 return 1;
18811881 } else {
libavformat/nutdec.c+1−1
@@ -728,7 +728,7 @@ static int nut_read_header(AVFormatContext *s) · 727 unmodified lines
728728 decode_info_header(nut);
729729 }
730730
731− s->data_offset = pos - 8;
731+ s->internal->data_offset = pos - 8;
732732
733733 if (bc->seekable) {
734734 int64_t orig_pos = avio_tell(bc);
libavformat/oggdec.c+3−3
@@ -414,8 +414,8 @@ static int ogg_packet(AVFormatContext *s, int *str, int *dstart, int *dsize, · 413 unmodified lines
414414
415415 // Update the header state for all streams and
416416 // compute the data_offset.
417− if (!s->data_offset)
418− s->data_offset = os->sync_pos;
417+ if (!s->internal->data_offset)
418+ s->internal->data_offset = os->sync_pos;
419419
420420 for (i = 0; i < ogg->nstreams; i++) {
421421 struct ogg_stream *cur_os = ogg->streams + i;
@@ -423,7 +423,7 @@ static int ogg_packet(AVFormatContext *s, int *str, int *dstart, int *dsize, · 1 unmodified line
423423 // if we have a partial non-header packet, its start is
424424 // obviously at or after the data start
425425 if (cur_os->incomplete)
426− s->data_offset = FFMIN(s->data_offset, cur_os->sync_pos);
426+ s->internal->data_offset = FFMIN(s->internal->data_offset, cur_os->sync_pos);
427427 }
428428 } else {
429429 os->nb_header++;
libavformat/options.c+1−1
@@ -101,13 +101,13 @@ AVFormatContext *avformat_alloc_context(void) · 100 unmodified lines
101101 ic = av_malloc(sizeof(AVFormatContext));
102102 if (!ic) return ic;
103103 avformat_get_context_defaults(ic);
104− ic->offset = AV_NOPTS_VALUE;
105104
106105 ic->internal = av_mallocz(sizeof(*ic->internal));
107106 if (!ic->internal) {
108107 avformat_free_context(ic);
109108 return NULL;
110109 }
110+ ic->internal->offset = AV_NOPTS_VALUE;
111111
112112 return ic;
113113 }
libavformat/pcm.c+2−1
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121
2222 #include "libavutil/mathematics.h"
2323 #include "avformat.h"
24+#include "internal.h"
2425 #include "pcm.h"
2526
2627 int ff_pcm_read_seek(AVFormatContext *s,
@@ -50,7 +51,7 @@ int ff_pcm_read_seek(AVFormatContext *s, · 23 unmodified lines
5051
5152 /* recompute exact position */
5253 st->cur_dts = av_rescale(pos, st->time_base.den, byte_rate * (int64_t)st->time_base.num);
53− if ((ret = avio_seek(s->pb, pos + s->data_offset, SEEK_SET)) < 0)
54+ if ((ret = avio_seek(s->pb, pos + s->internal->data_offset, SEEK_SET)) < 0)
5455 return ret;
5556 return 0;
5657 }
libavformat/r3d.c+3−3
@@ -183,8 +183,8 @@ static int r3d_read_header(AVFormatContext *s) · 182 unmodified lines
183183 return -1;
184184 }
185185
186− s->data_offset = avio_tell(s->pb);
187− av_dlog(s, "data offset %#"PRIx64"\n", s->data_offset);
186+ s->internal->data_offset = avio_tell(s->pb);
187+ av_dlog(s, "data offset %#"PRIx64"\n", s->internal->data_offset);
188188 if (!s->pb->seekable)
189189 return 0;
190190 // find REOB/REOF/REOS to load index
@@ -210,7 +210,7 @@ static int r3d_read_header(AVFormatContext *s) · 19 unmodified lines
210210 }
211211
212212 out:
213− avio_seek(s->pb, s->data_offset, SEEK_SET);
213+ avio_seek(s->pb, s->internal->data_offset, SEEK_SET);
214214 return 0;
215215 }
216216
libavformat/utils.c+39−38
@@ -238,8 +238,8 @@ static int queue_attached_pictures(AVFormatContext *s) · 237 unmodified lines
238238 if (!copy.buf)
239239 return AVERROR(ENOMEM);
240240
241− add_to_pktbuf(&s->raw_packet_buffer, &copy,
242− &s->raw_packet_buffer_end);
241+ add_to_pktbuf(&s->internal->raw_packet_buffer, &copy,
242+ &s->internal->raw_packet_buffer_end);
243243 }
244244 return 0;
245245 }
@@ -307,10 +307,10 @@ int avformat_open_input(AVFormatContext **ps, const char *filename, · 61 unmodified lines
307307 if ((ret = queue_attached_pictures(s)) < 0)
308308 goto fail;
309309
310− if (s->pb && !s->data_offset)
311− s->data_offset = avio_tell(s->pb);
310+ if (s->pb && !s->internal->data_offset)
311+ s->internal->data_offset = avio_tell(s->pb);
312312
313− s->raw_packet_buffer_remaining_size = RAW_PACKET_BUFFER_SIZE;
313+ s->internal->raw_packet_buffer_remaining_size = RAW_PACKET_BUFFER_SIZE;
314314
315315 if (options) {
316316 av_dict_free(options);
@@ -375,14 +375,14 @@ int ff_read_packet(AVFormatContext *s, AVPacket *pkt) · 58 unmodified lines
375375 AVStream *st;
376376
377377 for (;;) {
378− AVPacketList *pktl = s->raw_packet_buffer;
378+ AVPacketList *pktl = s->internal->raw_packet_buffer;
379379
380380 if (pktl) {
381381 *pkt = pktl->pkt;
382382 st = s->streams[pkt->stream_index];
383383 if (st->codec->codec_id != AV_CODEC_ID_PROBE ||
384384 !st->probe_packets ||
385− s->raw_packet_buffer_remaining_size < pkt->size) {
385+ s->internal->raw_packet_buffer_remaining_size < pkt->size) {
386386 AVProbeData *pd;
387387 if (st->probe_packets)
388388 if ((err = probe_codec(s, st, NULL)) < 0)
@@ -390,8 +390,8 @@ int ff_read_packet(AVFormatContext *s, AVPacket *pkt) · 1 unmodified line
390390 pd = &st->probe_data;
391391 av_freep(&pd->buf);
392392 pd->buf_size = 0;
393− s->raw_packet_buffer = pktl->next;
394− s->raw_packet_buffer_remaining_size += pkt->size;
393+ s->internal->raw_packet_buffer = pktl->next;
394+ s->internal->raw_packet_buffer_remaining_size += pkt->size;
395395 av_free(pktl);
396396 return 0;
397397 }
@@ -443,8 +443,9 @@ int ff_read_packet(AVFormatContext *s, AVPacket *pkt) · 45 unmodified lines
443443 !st->probe_packets))
444444 return ret;
445445
446− add_to_pktbuf(&s->raw_packet_buffer, pkt, &s->raw_packet_buffer_end);
447− s->raw_packet_buffer_remaining_size -= pkt->size;
446+ add_to_pktbuf(&s->internal->raw_packet_buffer, pkt,
447+ &s->internal->raw_packet_buffer_end);
448+ s->internal->raw_packet_buffer_remaining_size -= pkt->size;
448449
449450 if ((err = probe_codec(s, st, pkt)) < 0)
450451 return err;
@@ -515,7 +516,7 @@ static void update_initial_timestamps(AVFormatContext *s, int stream_index, · 64 unmodified lines
515516 int64_t dts, int64_t pts)
516517 {
517518 AVStream *st = s->streams[stream_index];
518− AVPacketList *pktl = s->packet_buffer;
519+ AVPacketList *pktl = s->internal->packet_buffer;
519520
520521 if (st->first_dts != AV_NOPTS_VALUE ||
521522 dts == AV_NOPTS_VALUE ||
@@ -545,7 +546,7 @@ static void update_initial_timestamps(AVFormatContext *s, int stream_index, · 23 unmodified lines
545546 static void update_initial_durations(AVFormatContext *s, AVStream *st,
546547 int stream_index, int duration)
547548 {
548− AVPacketList *pktl = s->packet_buffer;
549+ AVPacketList *pktl = s->internal->packet_buffer;
549550 int64_t cur_dts = 0;
550551
551552 if (st->first_dts != AV_NOPTS_VALUE) {
@@ -559,7 +560,7 @@ static void update_initial_durations(AVFormatContext *s, AVStream *st, · 7 unmodified lines
559560 cur_dts -= duration;
560561 }
561562 }
562− pktl = s->packet_buffer;
563+ pktl = s->internal->packet_buffer;
563564 st->first_dts = cur_dts;
564565 } else if (st->cur_dts)
565566 return;
@@ -628,7 +629,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st, · 62 unmodified lines
628629 den * (int64_t) st->time_base.num,
629630 AV_ROUND_DOWN);
630631
631− if (pkt->duration != 0 && s->packet_buffer)
632+ if (pkt->duration != 0 && s->internal->packet_buffer)
632633 update_initial_durations(s, st, pkt->stream_index,
633634 pkt->duration);
634635 }
@@ -691,7 +692,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st, · 56 unmodified lines
691692 num * (int64_t) st->time_base.den,
692693 den * (int64_t) st->time_base.num,
693694 AV_ROUND_DOWN);
694− if (duration != 0 && s->packet_buffer)
695+ if (duration != 0 && s->internal->packet_buffer)
695696 update_initial_durations(s, st, pkt->stream_index,
696697 duration);
697698 }
@@ -837,7 +838,7 @@ FF_ENABLE_DEPRECATION_WARNINGS · 139 unmodified lines
837838 if ((ret = av_dup_packet(&out_pkt)) < 0)
838839 goto fail;
839840
840− if (!add_to_pktbuf(&s->parse_queue, &out_pkt, &s->parse_queue_end)) {
841+ if (!add_to_pktbuf(&s->internal->parse_queue, &out_pkt, &s->internal->parse_queue_end)) {
841842 av_free_packet(&out_pkt);
842843 ret = AVERROR(ENOMEM);
843844 goto fail;
@@ -877,7 +878,7 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt) · 33 unmodified lines
877878
878879 av_init_packet(pkt);
879880
880− while (!got_packet && !s->parse_queue) {
881+ while (!got_packet && !s->internal->parse_queue) {
881882 AVStream *st;
882883 AVPacket cur_pkt;
883884
@@ -946,8 +947,8 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt) · 62 unmodified lines
946947 }
947948 }
948949
949− if (!got_packet && s->parse_queue)
950− ret = read_from_packet_buffer(&s->parse_queue, &s->parse_queue_end, pkt);
950+ if (!got_packet && s->internal->parse_queue)
951+ ret = read_from_packet_buffer(&s->internal->parse_queue, &s->internal->parse_queue_end, pkt);
951952
952953 av_opt_get_dict_val(s, "metadata", AV_OPT_SEARCH_CHILDREN, &metadata);
953954 if (metadata) {
@@ -973,14 +974,14 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt) · 19 unmodified lines
973974 int eof = 0;
974975
975976 if (!genpts)
976− return s->packet_buffer
977− ? read_from_packet_buffer(&s->packet_buffer,
978− &s->packet_buffer_end, pkt)
977+ return s->internal->packet_buffer
978+ ? read_from_packet_buffer(&s->internal->packet_buffer,
979+ &s->internal->packet_buffer_end, pkt)
979980 : read_frame_internal(s, pkt);
980981
981982 for (;;) {
982983 int ret;
983− AVPacketList *pktl = s->packet_buffer;
984+ AVPacketList *pktl = s->internal->packet_buffer;
984985
985986 if (pktl) {
986987 AVPacket *next_pkt = &pktl->pkt;
@@ -996,14 +997,14 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt) · 9 unmodified lines
996997 }
997998 pktl = pktl->next;
998999 }
999− pktl = s->packet_buffer;
1000+ pktl = s->internal->packet_buffer;
10001001 }
10011002
10021003 /* read packet from packet buffer, if there is data */
10031004 if (!(next_pkt->pts == AV_NOPTS_VALUE &&
10041005 next_pkt->dts != AV_NOPTS_VALUE && !eof))
1005− return read_from_packet_buffer(&s->packet_buffer,
1006− &s->packet_buffer_end, pkt);
1006+ return read_from_packet_buffer(&s->internal->packet_buffer,
1007+ &s->internal->packet_buffer_end, pkt);
10071008 }
10081009
10091010 ret = read_frame_internal(s, pkt);
@@ -1015,8 +1016,8 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt) · 5 unmodified lines
10151016 return ret;
10161017 }
10171018
1018− if (av_dup_packet(add_to_pktbuf(&s->packet_buffer, pkt,
1019− &s->packet_buffer_end)) < 0)
1019+ if (av_dup_packet(add_to_pktbuf(&s->internal->packet_buffer, pkt,
1020+ &s->internal->packet_buffer_end)) < 0)
10201021 return AVERROR(ENOMEM);
10211022 }
10221023 }
@@ -1024,11 +1025,11 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt) · 1 unmodified line
10241025 /* XXX: suppress the packet queue */
10251026 static void flush_packet_queue(AVFormatContext *s)
10261027 {
1027− free_packet_buffer(&s->parse_queue, &s->parse_queue_end);
1028− free_packet_buffer(&s->packet_buffer, &s->packet_buffer_end);
1029− free_packet_buffer(&s->raw_packet_buffer, &s->raw_packet_buffer_end);
1028+ free_packet_buffer(&s->internal->parse_queue, &s->internal->parse_queue_end);
1029+ free_packet_buffer(&s->internal->packet_buffer, &s->internal->packet_buffer_end);
1030+ free_packet_buffer(&s->internal->raw_packet_buffer, &s->internal->raw_packet_buffer_end);
10301031
1031− s->raw_packet_buffer_remaining_size = RAW_PACKET_BUFFER_SIZE;
1032+ s->internal->raw_packet_buffer_remaining_size = RAW_PACKET_BUFFER_SIZE;
10321033 }
10331034
10341035 /*******************************************************/
@@ -1287,7 +1288,7 @@ int64_t ff_gen_search(AVFormatContext *s, int stream_index, int64_t target_ts, · 252 unmodified lines
12871288 av_dlog(s, "gen_seek: %d %"PRId64"\n", stream_index, target_ts);
12881289
12891290 if (ts_min == AV_NOPTS_VALUE) {
1290− pos_min = s->data_offset;
1291+ pos_min = s->internal->data_offset;
12911292 ts_min = read_timestamp(s, stream_index, &pos_min, INT64_MAX);
12921293 if (ts_min == AV_NOPTS_VALUE)
12931294 return -1;
@@ -1394,7 +1395,7 @@ static int seek_frame_byte(AVFormatContext *s, int stream_index, · 100 unmodified lines
13941395 {
13951396 int64_t pos_min, pos_max;
13961397
1397− pos_min = s->data_offset;
1398+ pos_min = s->internal->data_offset;
13981399 pos_max = avio_size(s->pb) - 1;
13991400
14001401 if (pos < pos_min)
@@ -1433,7 +1434,7 @@ static int seek_frame_generic(AVFormatContext *s, int stream_index, · 32 unmodified lines
14331434 return ret;
14341435 ff_update_cur_dts(s, st, ie->timestamp);
14351436 } else {
1436− if ((ret = avio_seek(s->pb, s->data_offset, SEEK_SET)) < 0)
1437+ if ((ret = avio_seek(s->pb, s->internal->data_offset, SEEK_SET)) < 0)
14371438 return ret;
14381439 }
14391440 for (;;) {
@@ -2177,8 +2178,8 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) · 737 unmodified lines
21772178 if (ic->flags & AVFMT_FLAG_NOBUFFER) {
21782179 pkt = &pkt1;
21792180 } else {
2180− pkt = add_to_pktbuf(&ic->packet_buffer, &pkt1,
2181− &ic->packet_buffer_end);
2181+ pkt = add_to_pktbuf(&ic->internal->packet_buffer, &pkt1,
2182+ &ic->internal->packet_buffer_end);
21822183 if ((ret = av_dup_packet(pkt)) < 0)
21832184 goto find_stream_info_err;
21842185 }
libavformat/vqf.c+1−1
@@ -272,7 +272,7 @@ static int vqf_read_seek(AVFormatContext *s, · 271 unmodified lines
272272 st->cur_dts = av_rescale(pos, st->time_base.den,
273273 st->codec->bit_rate * (int64_t)st->time_base.num);
274274
275− if ((ret = avio_seek(s->pb, ((pos-7) >> 3) + s->data_offset, SEEK_SET)) < 0)
275+ if ((ret = avio_seek(s->pb, ((pos-7) >> 3) + s->internal->data_offset, SEEK_SET)) < 0)
276276 return ret;
277277
278278 c->remaining_bits = -7 - ((pos-7)&7);
libavformat/yop.c+1−1
@@ -194,7 +194,7 @@ static int yop_read_seek(AVFormatContext *s, int stream_index, · 193 unmodified lines
194194 if (!stream_index)
195195 return -1;
196196
197− pos_min = s->data_offset;
197+ pos_min = s->internal->data_offset;
198198 pos_max = avio_size(s->pb) - yop->frame_size;
199199 frame_count = (pos_max - pos_min) / yop->frame_size;
200200

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t