diff mbox series

[FFmpeg-devel,23/25] avformat/matroskaenc: Reindentation

Message ID AM7PR03MB666078A573D55570272B8ED28F569@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit 989e20690057801b41838592cf27d42fb3cb2c3c
Headers show
Series [FFmpeg-devel,01/25] avformat/matroskaenc: Fix potential overflow | expand

Checks

Context Check Description
andriy/make_aarch64_jetson success Make finished
andriy/make_fate_aarch64_jetson success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Jan. 16, 2022, 11:04 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/matroskaenc.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index e2f2dd7dae..28c7dee9b5 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -2735,22 +2735,22 @@  static int mkv_write_packet_internal(AVFormatContext *s, const AVPacket *pkt)
 
     /* The WebM spec requires WebVTT to be muxed in BlockGroups;
      * so we force it even for packets without duration. */
-        ret = mkv_write_block(s, mkv, pb, par, track, pkt,
-                              keyframe, ts, write_duration,
-                              par->codec_id == AV_CODEC_ID_WEBVTT);
+    ret = mkv_write_block(s, mkv, pb, par, track, pkt,
+                          keyframe, ts, write_duration,
+                          par->codec_id == AV_CODEC_ID_WEBVTT);
+    if (ret < 0)
+        return ret;
+    if (keyframe && IS_SEEKABLE(s->pb, mkv) &&
+        (par->codec_type == AVMEDIA_TYPE_VIDEO    ||
+         par->codec_type == AVMEDIA_TYPE_SUBTITLE ||
+         !mkv->have_video && !track->has_cue)) {
+        ret = mkv_add_cuepoint(mkv, pkt->stream_index, ts,
+                               mkv->cluster_pos, relative_packet_pos,
+                               write_duration);
         if (ret < 0)
             return ret;
-        if (keyframe && IS_SEEKABLE(s->pb, mkv) &&
-            (par->codec_type == AVMEDIA_TYPE_VIDEO    ||
-             par->codec_type == AVMEDIA_TYPE_SUBTITLE ||
-             !mkv->have_video && !track->has_cue)) {
-            ret = mkv_add_cuepoint(mkv, pkt->stream_index, ts,
-                                   mkv->cluster_pos, relative_packet_pos,
-                                   write_duration);
-            if (ret < 0)
-                return ret;
-            track->has_cue = 1;
-        }
+        track->has_cue = 1;
+    }
 
     track->last_timestamp = ts;
     mkv->duration   = FFMAX(mkv->duration,   ts + duration);