diff options
author | Anton Khirnov <anton@khirnov.net> | 2021-12-12 13:37:37 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2022-07-23 11:53:19 +0200 |
commit | ec00b005f9fa0942954bfc865f3b9606aa957a3c (patch) | |
tree | f41d1a79ae8484d3ff9ed4913bc7822dae44bddb /fftools/ffmpeg.c | |
parent | 6999a3cb18869726ffc8a246ffa211f07efbfeb6 (diff) | |
download | ffmpeg-ec00b005f9fa0942954bfc865f3b9606aa957a3c.tar.gz |
fftools/ffmpeg_mux: split of_write_packet()
It is currently called from two places:
- output_packet() in ffmpeg.c, which submits the newly available output
packet to the muxer
- from of_check_init() in ffmpeg_mux.c after the header has been
written, to flush the muxing queue
Some packets will thus be processed by this function twice, so it
requires an extra parameter to indicate the place it is called from and
avoid modifying some state twice.
This is fragile and hard to follow, so split this function into two.
Also rename of_write_packet() to of_submit_packet() to better reflect
its new purpose.
Diffstat (limited to 'fftools/ffmpeg.c')
-rw-r--r-- | fftools/ffmpeg.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 3c859fca3a..7b54280414 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -724,11 +724,11 @@ static void output_packet(OutputFile *of, AVPacket *pkt, if (ret < 0) goto finish; while ((ret = av_bsf_receive_packet(ost->bsf_ctx, pkt)) >= 0) - of_write_packet(of, pkt, ost, 0); + of_submit_packet(of, pkt, ost); if (ret == AVERROR(EAGAIN)) ret = 0; } else if (!eof) - of_write_packet(of, pkt, ost, 0); + of_submit_packet(of, pkt, ost); finish: if (ret < 0 && ret != AVERROR_EOF) { |