[FFmpeg-cvslog] avformat/mux: Call check_packet() more directly
Andreas Rheinhardt
git at videolan.org
Sat May 16 04:11:00 EEST 2020
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Sat May 16 02:04:34 2020 +0200| [718f05f5e5cfc38a5123deac7259f548b2f04751] | committer: Andreas Rheinhardt
avformat/mux: Call check_packet() more directly
Call it directly from write_packets_common() instead of indirectly
through prepare_input_packet().
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=718f05f5e5cfc38a5123deac7259f548b2f04751
---
libavformat/mux.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/libavformat/mux.c b/libavformat/mux.c
index f2de73af9b..b08d48b5fb 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -759,16 +759,8 @@ static int check_packet(AVFormatContext *s, AVPacket *pkt)
return 0;
}
-static int prepare_input_packet(AVFormatContext *s, AVPacket *pkt)
+static int prepare_input_packet(AVFormatContext *s, AVStream *st, AVPacket *pkt)
{
- AVStream *st;
- int ret;
-
- ret = check_packet(s, pkt);
- if (ret < 0)
- return ret;
- st = s->streams[pkt->stream_index];
-
#if !FF_API_COMPUTE_PKT_FIELDS2 || !FF_API_LAVF_AVCTX
/* sanitize the timestamps */
if (!(s->oformat->flags & AVFMT_NOTIMESTAMPS)) {
@@ -1178,11 +1170,15 @@ static int write_packets_from_bsfs(AVFormatContext *s, AVStream *st, AVPacket *p
static int write_packets_common(AVFormatContext *s, AVPacket *pkt, int interleaved)
{
AVStream *st;
- int ret = prepare_input_packet(s, pkt);
+ int ret = check_packet(s, pkt);
if (ret < 0)
return ret;
st = s->streams[pkt->stream_index];
+ ret = prepare_input_packet(s, st, pkt);
+ if (ret < 0)
+ return ret;
+
ret = check_bitstream(s, st, pkt);
if (ret < 0)
return ret;
More information about the ffmpeg-cvslog
mailing list