[FFmpeg-cvslog] movenc: Factorize a function for finishing a written fragment
Martin Storsjö
git at videolan.org
Mon Jun 24 11:24:30 EEST 2024
ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Sun Nov 2 00:21:01 2014 +0200| [4b8ddf71dcd3340c64649f7be3d23e8df517aae5] | committer: Martin Storsjö
movenc: Factorize a function for finishing a written fragment
Signed-off-by: Martin Storsjö <martin at martin.st>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4b8ddf71dcd3340c64649f7be3d23e8df517aae5
---
libavformat/movenc.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index a6d6e00cde..67ed9e33fd 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -5994,6 +5994,16 @@ static int mov_write_squashed_packets(AVFormatContext *s)
return 0;
}
+static int mov_finish_fragment(MOVTrack *track)
+{
+ if (!track->entry)
+ return 0;
+ track->entry = 0;
+ track->entries_flushed = 0;
+ track->end_reliable = 0;
+ return 0;
+}
+
static int mov_flush_fragment(AVFormatContext *s, int force)
{
MOVMuxContext *mov = s->priv_data;
@@ -6103,10 +6113,8 @@ static int mov_flush_fragment(AVFormatContext *s, int force)
mov->moov_written = 1;
mov->mdat_size = 0;
- for (i = 0; i < mov->nb_tracks; i++) {
- mov->tracks[i].entry = 0;
- mov->tracks[i].end_reliable = 0;
- }
+ for (i = 0; i < mov->nb_tracks; i++)
+ mov_finish_fragment(&mov->tracks[i]);
avio_write_marker(s->pb, AV_NOPTS_VALUE, AVIO_DATA_MARKER_FLUSH_POINT);
return 0;
}
@@ -6177,9 +6185,7 @@ static int mov_flush_fragment(AVFormatContext *s, int force)
ffio_wfourcc(s->pb, "mdat");
}
- track->entry = 0;
- track->entries_flushed = 0;
- track->end_reliable = 0;
+ mov_finish_fragment(&mov->tracks[i]);
if (!mov->frag_interleave) {
if (!track->mdat_buf)
continue;
More information about the ffmpeg-cvslog
mailing list