summaryrefslogtreecommitdiff
path: root/libavformat/dashenc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-11-18 21:48:49 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-11-27 12:55:41 +0100
commita5ee1663270cd15fa4d5f40d384a8d9eab4f7218 (patch)
tree18b4821e4f298b96c9e6e32bfba6c2181dbd5b8b /libavformat/dashenc.c
parentc90b3661fadcec98ab6462ac9f8180aa0cb8ec62 (diff)
avformat/avformat: Add AVStream parameter to check_bitstream() sig
For most check_bitstream() functions this just avoids having to dereference s->streams[pkt->stream_index] themselves; but for meta-muxers it will allow to forward the packet to stream with a different stream_index (belonging to a different AVFormatContext) without using a spare packet. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/dashenc.c')
-rw-r--r--libavformat/dashenc.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 5faf06e11d..dd2b34afbb 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -2333,19 +2333,21 @@ static int dash_write_trailer(AVFormatContext *s)
return 0;
}
-static int dash_check_bitstream(struct AVFormatContext *s, const AVPacket *avpkt)
+static int dash_check_bitstream(AVFormatContext *s, AVStream *st,
+ const AVPacket *avpkt)
{
DASHContext *c = s->priv_data;
- OutputStream *os = &c->streams[avpkt->stream_index];
+ OutputStream *os = &c->streams[st->index];
AVFormatContext *oc = os->ctx;
if (oc->oformat->check_bitstream) {
+ AVStream *const ost = oc->streams[0];
int ret;
AVPacket pkt = *avpkt;
pkt.stream_index = 0;
- ret = oc->oformat->check_bitstream(oc, &pkt);
+ ret = oc->oformat->check_bitstream(oc, ost, &pkt);
if (ret == 1) {
- FFStream *const sti = ffstream(s->streams[avpkt->stream_index]);
- FFStream *const osti = ffstream(oc->streams[0]);
+ FFStream *const sti = ffstream(st);
+ FFStream *const osti = ffstream(ost);
sti->bsfc = osti->bsfc;
osti->bsfc = NULL;
}