Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-08-24 20:41:16 +0300
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-09-17 14:22:25 +0300
commit40bdd8cc05d9c98a18cf2b1c2a00c8a5a7b38113 (patch)
tree0fc408f78b9b6934ac351cd4499c07737f8f6a62 /libavformat/hdsenc.c
parent9f05b3ba604a30eeb6f5ff877b8b5b5c93a268d7 (diff)
avformat: Avoid allocation for AVStreamInternal
Do this by allocating AVStream together with the data that is currently in AVStreamInternal; or rather: Put AVStream at the beginning of a new structure called FFStream (which encompasses more than just the internal fields and is a proper context in its own right, hence the name) and remove AVStreamInternal altogether. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/hdsenc.c')
-rw-r--r--libavformat/hdsenc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavformat/hdsenc.c b/libavformat/hdsenc.c
index 1793fb69d5..a603d5067e 100644
--- a/libavformat/hdsenc.c
+++ b/libavformat/hdsenc.c
@@ -500,15 +500,16 @@ static int hds_write_packet(AVFormatContext *s, AVPacket *pkt)
{
HDSContext *c = s->priv_data;
AVStream *st = s->streams[pkt->stream_index];
+ FFStream *const sti = ffstream(st);
OutputStream *os = &c->streams[s->streams[pkt->stream_index]->id];
int64_t end_dts = os->fragment_index * (int64_t)c->min_frag_duration;
int ret;
- if (st->internal->first_dts == AV_NOPTS_VALUE)
- st->internal->first_dts = pkt->dts;
+ if (sti->first_dts == AV_NOPTS_VALUE)
+ sti->first_dts = pkt->dts;
if ((!os->has_video || st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) &&
- av_compare_ts(pkt->dts - st->internal->first_dts, st->time_base,
+ av_compare_ts(pkt->dts - sti->first_dts, st->time_base,
end_dts, AV_TIME_BASE_Q) >= 0 &&
pkt->flags & AV_PKT_FLAG_KEY && os->packets_written) {