summaryrefslogtreecommitdiff
path: root/libavformat/mux.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-11-05 14:59:47 -0300
committerJames Almer <jamrial@gmail.com>2017-11-07 23:20:50 -0300
commitcd1ff3e45d45ce8d733b4acc8e23444c1a227d07 (patch)
treec3f6b3dc413d55ba09e12441e81b6185d651e911 /libavformat/mux.c
parent2c2f25eb8920129ef3cfe6da2e1cefdedc485965 (diff)
avformat: move priv_pts from AVStream to an internal struct
It has no reason to be in a public header, even if defined as private. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/mux.c')
-rw-r--r--libavformat/mux.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/libavformat/mux.c b/libavformat/mux.c
index 1445e7dcd6..b1244c67f3 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -432,16 +432,16 @@ static int init_pts(AVFormatContext *s)
break;
}
- if (!st->priv_pts)
- st->priv_pts = av_mallocz(sizeof(*st->priv_pts));
- if (!st->priv_pts)
+ if (!st->internal->priv_pts)
+ st->internal->priv_pts = av_mallocz(sizeof(*st->internal->priv_pts));
+ if (!st->internal->priv_pts)
return AVERROR(ENOMEM);
if (den != AV_NOPTS_VALUE) {
if (den <= 0)
return AVERROR_INVALIDDATA;
- frac_init(st->priv_pts, 0, 0, den);
+ frac_init(st->internal->priv_pts, 0, 0, den);
}
}
@@ -601,7 +601,7 @@ static int compute_muxer_pkt_fields(AVFormatContext *s, AVStream *st, AVPacket *
}
pkt->dts =
// pkt->pts= st->cur_dts;
- pkt->pts = st->priv_pts->val;
+ pkt->pts = st->internal->priv_pts->val;
}
//calculate dts from pts
@@ -638,7 +638,7 @@ static int compute_muxer_pkt_fields(AVFormatContext *s, AVStream *st, AVPacket *
av_ts2str(pkt->pts), av_ts2str(pkt->dts));
st->cur_dts = pkt->dts;
- st->priv_pts->val = pkt->dts;
+ st->internal->priv_pts->val = pkt->dts;
/* update pts */
switch (st->codecpar->codec_type) {
@@ -650,12 +650,12 @@ static int compute_muxer_pkt_fields(AVFormatContext *s, AVStream *st, AVPacket *
/* HACK/FIXME, we skip the initial 0 size packets as they are most
* likely equal to the encoder delay, but it would be better if we
* had the real timestamps from the encoder */
- if (frame_size >= 0 && (pkt->size || st->priv_pts->num != st->priv_pts->den >> 1 || st->priv_pts->val)) {
- frac_add(st->priv_pts, (int64_t)st->time_base.den * frame_size);
+ if (frame_size >= 0 && (pkt->size || st->internal->priv_pts->num != st->internal->priv_pts->den >> 1 || st->internal->priv_pts->val)) {
+ frac_add(st->internal->priv_pts, (int64_t)st->time_base.den * frame_size);
}
break;
case AVMEDIA_TYPE_VIDEO:
- frac_add(st->priv_pts, (int64_t)st->time_base.den * st->time_base.num);
+ frac_add(st->internal->priv_pts, (int64_t)st->time_base.den * st->time_base.num);
break;
}
return 0;