Commit 718f05f5 authored by Andreas Rheinhardt's avatar 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: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
parent 39195896
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment