Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: softworkz <ffmpegagent-at-gmail.com@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: softworkz <softworkz@hotmail.com>
Subject: [FFmpeg-devel] [PATCH 10/10] avformat/segment: Indent and whitespace fixes
Date: Fri, 13 Jun 2025 05:54:26 +0000
Message-ID: <88a8dc78756633d546571bd224966f81993fcf8b.1749794067.git.ffmpegagent@gmail.com> (raw)
In-Reply-To: <pull.96.ffstaging.FFmpeg.1749794066.ffmpegagent@gmail.com>

From: softworkz <softworkz@hotmail.com>

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 libavformat/segment.c | 48 +++++++++++++++++++++----------------------
 1 file changed, 23 insertions(+), 25 deletions(-)

diff --git a/libavformat/segment.c b/libavformat/segment.c
index 3cd9e313f4..8e1e4a9c0c 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -177,7 +177,7 @@ static int segment_mux_init(AVFormatContext *s)
             return AVERROR(ENOMEM);
         opar = st->codecpar;
         if (!oc->oformat->codec_tag ||
-            av_codec_get_id (oc->oformat->codec_tag, ipar->codec_tag) == opar->codec_id ||
+            av_codec_get_id(oc->oformat->codec_tag, ipar->codec_tag) == opar->codec_id ||
             av_codec_get_tag(oc->oformat->codec_tag, ipar->codec_id) <= 0) {
             opar->codec_tag = ipar->codec_tag;
         } else {
@@ -340,17 +340,17 @@ static void segment_list_print_entry(AVIOContext      *list_ioctx,
                     list_entry->end_time - list_entry->start_time, list_entry->filename);
         break;
     case LIST_TYPE_FFCONCAT:
-    {
-        char *buf;
-        if (av_escape(&buf, list_entry->filename, NULL, AV_ESCAPE_MODE_AUTO, AV_ESCAPE_FLAG_WHITESPACE) < 0) {
-            av_log(log_ctx, AV_LOG_WARNING,
-                   "Error writing list entry '%s' in list file\n", list_entry->filename);
-            return;
+        {
+            char *buf;
+            if (av_escape(&buf, list_entry->filename, NULL, AV_ESCAPE_MODE_AUTO, AV_ESCAPE_FLAG_WHITESPACE) < 0) {
+                av_log(log_ctx, AV_LOG_WARNING,
+                       "Error writing list entry '%s' in list file\n", list_entry->filename);
+                return;
+            }
+            avio_printf(list_ioctx, "file %s\n", buf);
+            av_free(buf);
+            break;
         }
-        avio_printf(list_ioctx, "file %s\n", buf);
-        av_free(buf);
-        break;
-    }
     default:
         av_assert0(!"Invalid list type");
     }
@@ -456,8 +456,8 @@ static int segment_end(AVFormatContext *s, int write_trailer, int is_last)
                         av_log(s, AV_LOG_WARNING, "Could not increment stream %d timecode, error occurred during timecode creation.\n", i);
                         continue;
                     }
-                st_tc.start += (int)((seg->cur_entry.end_time - seg->cur_entry.start_time) * av_q2d(st_rate));    // increment timecode
-                av_dict_set(&s->streams[i]->metadata, "timecode", av_timecode_make_string(&st_tc, st_buf, 0), 0);
+                    st_tc.start += (int)((seg->cur_entry.end_time - seg->cur_entry.start_time) * av_q2d(st_rate));    // increment timecode
+                    av_dict_set(&s->streams[i]->metadata, "timecode", av_timecode_make_string(&st_tc, st_buf, 0), 0);
                 }
             }
         }
@@ -755,8 +755,8 @@ static int seg_init(AVFormatContext *s)
 
     if (seg->list) {
         if (seg->list_type == LIST_TYPE_UNDEFINED) {
-            if      (av_match_ext(seg->list, "csv" )) seg->list_type = LIST_TYPE_CSV;
-            else if (av_match_ext(seg->list, "ext" )) seg->list_type = LIST_TYPE_EXT;
+            if      (av_match_ext(seg->list, "csv")) seg->list_type = LIST_TYPE_CSV;
+            else if (av_match_ext(seg->list, "ext")) seg->list_type = LIST_TYPE_EXT;
             else if (av_match_ext(seg->list, "m3u8")) seg->list_type = LIST_TYPE_M3U8;
             else if (av_match_ext(seg->list, "ffcat,ffconcat")) seg->list_type = LIST_TYPE_FFCONCAT;
             else                                      seg->list_type = LIST_TYPE_FLAT;
@@ -911,11 +911,9 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
 
 calc_times:
     if (seg->times) {
-        end_pts = seg->segment_count < seg->nb_times ?
-            seg->times[seg->segment_count] : INT64_MAX;
+        end_pts = seg->segment_count < seg->nb_times ? seg->times[seg->segment_count] : INT64_MAX;
     } else if (seg->frames) {
-        start_frame = seg->segment_count < seg->nb_frames ?
-            seg->frames[seg->segment_count] : INT_MAX;
+        start_frame = seg->segment_count < seg->nb_frames ? seg->frames[seg->segment_count] : INT_MAX;
     } else {
         if (seg->use_clocktime) {
             int64_t avgt = av_gettime();
@@ -956,10 +954,10 @@ calc_times:
         (pkt->flags & AV_PKT_FLAG_KEY || seg->break_non_keyframes) &&
         (seg->segment_frame_count > 0 || seg->write_empty) &&
         (seg->cut_pending || seg->frame_count >= start_frame ||
-         (pkt->pts != AV_NOPTS_VALUE &&
-          pkt_pts_avtb - seg->cur_entry.start_pts >= seg->min_seg_duration &&
-          av_compare_ts(pkt->pts, st->time_base,
-                        end_pts - seg->time_delta, AV_TIME_BASE_Q) >= 0))) {
+            (pkt->pts != AV_NOPTS_VALUE &&
+                pkt_pts_avtb - seg->cur_entry.start_pts >= seg->min_seg_duration &&
+                av_compare_ts(pkt->pts, st->time_base,
+                              end_pts - seg->time_delta, AV_TIME_BASE_Q) >= 0))) {
         /* sanitize end time in case last packet didn't have a defined duration */
         if (seg->cur_entry.last_duration == 0)
             seg->cur_entry.end_time = (double)pkt->pts * av_q2d(st->time_base);
@@ -1064,8 +1062,8 @@ static int seg_check_bitstream(AVFormatContext *s, AVStream *st,
         if (ret == 1) {
             FFStream *const  sti = ffstream(st);
             FFStream *const osti = ffstream(ost);
-             sti->bsfc = osti->bsfc;
-            osti->bsfc = NULL;
+            sti->bsfc            = osti->bsfc;
+            osti->bsfc           = NULL;
         }
         return ret;
     }
-- 
ffmpeg-codebot
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

  parent reply	other threads:[~2025-06-13  5:56 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-13  5:54 [FFmpeg-devel] [PATCH 00/10] avformat/segment: Various segment muxer improvements ffmpegagent
2025-06-13  5:54 ` [FFmpeg-devel] [PATCH 01/10] avformat/segment: Add segment_write_temp option softworkz
2025-06-13 20:37   ` Marton Balint
2025-06-13 21:43     ` softworkz .
2025-06-13 22:07       ` Marton Balint
2025-06-13 22:26         ` softworkz .
2025-06-13  5:54 ` [FFmpeg-devel] [PATCH 02/10] doc/muxers: Add documentation for " softworkz
2025-06-13  5:54 ` [FFmpeg-devel] [PATCH 03/10] avformat/segment: Log more detailed information about written segments softworkz
2025-06-13 13:42   ` Derek Buitenhuis
2025-06-13 14:03     ` softworkz .
2025-06-13 20:44   ` Marton Balint
2025-06-13 23:53     ` softworkz .
2025-06-13  5:54 ` [FFmpeg-devel] [PATCH 04/10] avformat/segment: Add segment_limit option softworkz
2025-06-13  5:54 ` [FFmpeg-devel] [PATCH 05/10] doc/muxers: Add documentation for " softworkz
2025-06-13 20:25   ` Marton Balint
2025-06-13 21:33     ` softworkz .
2025-06-13 21:59       ` Marton Balint
2025-06-13 22:49         ` softworkz .
2025-06-14 15:59           ` Marton Balint
2025-06-13  5:54 ` [FFmpeg-devel] [PATCH 06/10] avformat/segment: Fix invalid codecpar extradata_size after copying softworkz
2025-06-13  6:03   ` softworkz .
2025-06-13  5:54 ` [FFmpeg-devel] [PATCH 07/10] avformat/segment: Remove non-negative constraint from segment_time_delta softworkz
2025-06-13  5:54 ` [FFmpeg-devel] [PATCH 08/10] avformat/segment: Don't allow negative segment duration softworkz
2025-06-13  5:54 ` [FFmpeg-devel] [PATCH 09/10] avformat/segment: Fix typo softworkz
2025-06-13  5:54 ` softworkz [this message]
2025-06-14  0:59 ` [FFmpeg-devel] [PATCH v2 0/6] avformat/segment: Various segment muxer improvements ffmpegagent
2025-06-14  0:59   ` [FFmpeg-devel] [PATCH v2 1/6] avformat/segment: Add segment_write_temp option softworkz
2025-06-14  0:59   ` [FFmpeg-devel] [PATCH v2 2/6] avformat/segment: Add segment_limit option softworkz
2025-06-14  0:59   ` [FFmpeg-devel] [PATCH v2 3/6] avformat/segment: Remove non-negative constraint from segment_time_delta softworkz
2025-06-14  0:59   ` [FFmpeg-devel] [PATCH v2 4/6] avformat/segment: Don't allow negative segment duration softworkz
2025-06-14 20:40     ` Michael Niedermayer
2025-06-14  0:59   ` [FFmpeg-devel] [PATCH v2 5/6] avformat/segment: Fix typo softworkz
2025-06-14  0:59   ` [FFmpeg-devel] [PATCH v2 6/6] avformat/segment: Indent and whitespace fixes softworkz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=88a8dc78756633d546571bd224966f81993fcf8b.1749794067.git.ffmpegagent@gmail.com \
    --to=ffmpegagent-at-gmail.com@ffmpeg.org \
    --cc=ffmpeg-devel@ffmpeg.org \
    --cc=softworkz@hotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git