diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-11-18 21:48:49 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-11-27 12:55:41 +0100 |
commit | a5ee1663270cd15fa4d5f40d384a8d9eab4f7218 (patch) | |
tree | 18b4821e4f298b96c9e6e32bfba6c2181dbd5b8b /libavformat/segment.c | |
parent | c90b3661fadcec98ab6462ac9f8180aa0cb8ec62 (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/segment.c')
-rw-r--r-- | libavformat/segment.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libavformat/segment.c b/libavformat/segment.c index 2b024fd373..9861462405 100644 --- a/libavformat/segment.c +++ b/libavformat/segment.c @@ -984,15 +984,17 @@ static int seg_write_trailer(struct AVFormatContext *s) return ret; } -static int seg_check_bitstream(struct AVFormatContext *s, const AVPacket *pkt) +static int seg_check_bitstream(AVFormatContext *s, AVStream *st, + const AVPacket *pkt) { SegmentContext *seg = s->priv_data; AVFormatContext *oc = seg->avf; if (oc->oformat->check_bitstream) { - int ret = oc->oformat->check_bitstream(oc, pkt); + AVStream *const ost = oc->streams[st->index]; + int ret = oc->oformat->check_bitstream(oc, ost, pkt); if (ret == 1) { - FFStream *const sti = ffstream( s->streams[pkt->stream_index]); - FFStream *const osti = ffstream(oc->streams[pkt->stream_index]); + FFStream *const sti = ffstream(st); + FFStream *const osti = ffstream(ost); sti->bsfc = osti->bsfc; osti->bsfc = NULL; } |