* [FFmpeg-devel] [PATCH] avformat/nutenc: Fix indentation
@ 2024-02-03 19:20 Andreas Rheinhardt
2024-02-04 7:20 ` Leo Izen
2024-02-06 9:00 ` Andreas Rheinhardt
0 siblings, 2 replies; 4+ messages in thread
From: Andreas Rheinhardt @ 2024-02-03 19:20 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Forgotten after 82beb46e65e5f820b187355bf757725c22a59c45.
Also use loop-scope for iterators while at it.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavformat/nutenc.c | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index a5198c7ca9..5e0e36babe 100644
--- a/libavformat/nutenc.c
+++ b/libavformat/nutenc.c
@@ -1063,21 +1063,21 @@ static int nut_write_packet(AVFormatContext *s, AVPacket *pkt)
ffio_free_dyn_buf(&dyn_bc);
if (nut->write_index) {
- if ((ret = ff_nut_add_sp(nut, nut->last_syncpoint_pos, 0 /*unused*/, pkt->dts)) < 0)
- goto fail;
-
- if ((1ll<<60) % nut->sp_count == 0)
- for (i=0; i<s->nb_streams; i++) {
- int j;
- StreamContext *nus = &nut->stream[i];
- av_reallocp_array(&nus->keyframe_pts, 2*nut->sp_count, sizeof(*nus->keyframe_pts));
- if (!nus->keyframe_pts) {
- ret = AVERROR(ENOMEM);
- goto fail;
- }
- for (j=nut->sp_count == 1 ? 0 : nut->sp_count; j<2*nut->sp_count; j++)
- nus->keyframe_pts[j] = AV_NOPTS_VALUE;
- }
+ if ((ret = ff_nut_add_sp(nut, nut->last_syncpoint_pos, 0 /*unused*/, pkt->dts)) < 0)
+ goto fail;
+
+ if ((1ll<<60) % nut->sp_count == 0)
+ for (unsigned i = 0; i < s->nb_streams; i++) {
+ StreamContext *nus = &nut->stream[i];
+ av_reallocp_array(&nus->keyframe_pts, 2*nut->sp_count, sizeof(*nus->keyframe_pts));
+ if (!nus->keyframe_pts) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
+ for (int j = nut->sp_count == 1 ? 0 : nut->sp_count;
+ j < 2 * nut->sp_count; j++)
+ nus->keyframe_pts[j] = AV_NOPTS_VALUE;
+ }
}
}
av_assert0(nus->last_pts != AV_NOPTS_VALUE);
--
2.34.1
_______________________________________________
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".
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avformat/nutenc: Fix indentation
2024-02-03 19:20 [FFmpeg-devel] [PATCH] avformat/nutenc: Fix indentation Andreas Rheinhardt
@ 2024-02-04 7:20 ` Leo Izen
2024-02-04 9:12 ` Anton Khirnov
2024-02-06 9:00 ` Andreas Rheinhardt
1 sibling, 1 reply; 4+ messages in thread
From: Leo Izen @ 2024-02-04 7:20 UTC (permalink / raw)
To: ffmpeg-devel
[-- Attachment #1.1.1: Type: text/plain, Size: 2697 bytes --]
On 2/3/24 14:20, Andreas Rheinhardt wrote:
> Forgotten after 82beb46e65e5f820b187355bf757725c22a59c45.
> Also use loop-scope for iterators while at it.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> libavformat/nutenc.c | 30 +++++++++++++++---------------
> 1 file changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
> index a5198c7ca9..5e0e36babe 100644
> --- a/libavformat/nutenc.c
> +++ b/libavformat/nutenc.c
> @@ -1063,21 +1063,21 @@ static int nut_write_packet(AVFormatContext *s, AVPacket *pkt)
> ffio_free_dyn_buf(&dyn_bc);
>
> if (nut->write_index) {
> - if ((ret = ff_nut_add_sp(nut, nut->last_syncpoint_pos, 0 /*unused*/, pkt->dts)) < 0)
> - goto fail;
> -
> - if ((1ll<<60) % nut->sp_count == 0)
> - for (i=0; i<s->nb_streams; i++) {
> - int j;
> - StreamContext *nus = &nut->stream[i];
> - av_reallocp_array(&nus->keyframe_pts, 2*nut->sp_count, sizeof(*nus->keyframe_pts));
> - if (!nus->keyframe_pts) {
> - ret = AVERROR(ENOMEM);
> - goto fail;
> - }
> - for (j=nut->sp_count == 1 ? 0 : nut->sp_count; j<2*nut->sp_count; j++)
> - nus->keyframe_pts[j] = AV_NOPTS_VALUE;
> - }
> + if ((ret = ff_nut_add_sp(nut, nut->last_syncpoint_pos, 0 /*unused*/, pkt->dts)) < 0)
> + goto fail;
> +
> + if ((1ll<<60) % nut->sp_count == 0)
> + for (unsigned i = 0; i < s->nb_streams; i++) {
> + StreamContext *nus = &nut->stream[i];
> + av_reallocp_array(&nus->keyframe_pts, 2*nut->sp_count, sizeof(*nus->keyframe_pts));
> + if (!nus->keyframe_pts) {
> + ret = AVERROR(ENOMEM);
> + goto fail;
> + }
> + for (int j = nut->sp_count == 1 ? 0 : nut->sp_count;
> + j < 2 * nut->sp_count; j++)
> + nus->keyframe_pts[j] = AV_NOPTS_VALUE;
> + }
> }
> }
> av_assert0(nus->last_pts != AV_NOPTS_VALUE);
If we're changing this block of code anyway, could we possibly replace
this line:
if ((ret = ff_nut_add_sp(nut, nut->last_syncpoint_pos, 0
/*unused*/, pkt->dts)) < 0)
goto fail;
With something like this?
ret = ff_nut_add_sp(nut, nut->last_syncpoint_pos, 0 /*unused*/, pkt->dts);
if (ret < 0)
goto fail;
It's a bit cleaner.
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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".
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avformat/nutenc: Fix indentation
2024-02-04 7:20 ` Leo Izen
@ 2024-02-04 9:12 ` Anton Khirnov
0 siblings, 0 replies; 4+ messages in thread
From: Anton Khirnov @ 2024-02-04 9:12 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Quoting Leo Izen (2024-02-04 08:20:55)
>
> If we're changing this block of code anyway, could we possibly replace
> this line:
>
> if ((ret = ff_nut_add_sp(nut, nut->last_syncpoint_pos, 0
> /*unused*/, pkt->dts)) < 0)
> goto fail;
>
> With something like this?
>
> ret = ff_nut_add_sp(nut, nut->last_syncpoint_pos, 0 /*unused*/, pkt->dts);
> if (ret < 0)
> goto fail;
>
> It's a bit cleaner.
I much prefer not to mix whitespace and other changes, it breaks
color-moved, ignore-all-space and similar.
--
Anton Khirnov
_______________________________________________
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".
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avformat/nutenc: Fix indentation
2024-02-03 19:20 [FFmpeg-devel] [PATCH] avformat/nutenc: Fix indentation Andreas Rheinhardt
2024-02-04 7:20 ` Leo Izen
@ 2024-02-06 9:00 ` Andreas Rheinhardt
1 sibling, 0 replies; 4+ messages in thread
From: Andreas Rheinhardt @ 2024-02-06 9:00 UTC (permalink / raw)
To: ffmpeg-devel
Andreas Rheinhardt:
> Forgotten after 82beb46e65e5f820b187355bf757725c22a59c45.
> Also use loop-scope for iterators while at it.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> libavformat/nutenc.c | 30 +++++++++++++++---------------
> 1 file changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
> index a5198c7ca9..5e0e36babe 100644
> --- a/libavformat/nutenc.c
> +++ b/libavformat/nutenc.c
> @@ -1063,21 +1063,21 @@ static int nut_write_packet(AVFormatContext *s, AVPacket *pkt)
> ffio_free_dyn_buf(&dyn_bc);
>
> if (nut->write_index) {
> - if ((ret = ff_nut_add_sp(nut, nut->last_syncpoint_pos, 0 /*unused*/, pkt->dts)) < 0)
> - goto fail;
> -
> - if ((1ll<<60) % nut->sp_count == 0)
> - for (i=0; i<s->nb_streams; i++) {
> - int j;
> - StreamContext *nus = &nut->stream[i];
> - av_reallocp_array(&nus->keyframe_pts, 2*nut->sp_count, sizeof(*nus->keyframe_pts));
> - if (!nus->keyframe_pts) {
> - ret = AVERROR(ENOMEM);
> - goto fail;
> - }
> - for (j=nut->sp_count == 1 ? 0 : nut->sp_count; j<2*nut->sp_count; j++)
> - nus->keyframe_pts[j] = AV_NOPTS_VALUE;
> - }
> + if ((ret = ff_nut_add_sp(nut, nut->last_syncpoint_pos, 0 /*unused*/, pkt->dts)) < 0)
> + goto fail;
> +
> + if ((1ll<<60) % nut->sp_count == 0)
> + for (unsigned i = 0; i < s->nb_streams; i++) {
> + StreamContext *nus = &nut->stream[i];
> + av_reallocp_array(&nus->keyframe_pts, 2*nut->sp_count, sizeof(*nus->keyframe_pts));
> + if (!nus->keyframe_pts) {
> + ret = AVERROR(ENOMEM);
> + goto fail;
> + }
> + for (int j = nut->sp_count == 1 ? 0 : nut->sp_count;
> + j < 2 * nut->sp_count; j++)
> + nus->keyframe_pts[j] = AV_NOPTS_VALUE;
> + }
> }
> }
> av_assert0(nus->last_pts != AV_NOPTS_VALUE);
Will apply tonight unless there are objections.
- Andreas
_______________________________________________
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".
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-02-06 8:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-03 19:20 [FFmpeg-devel] [PATCH] avformat/nutenc: Fix indentation Andreas Rheinhardt
2024-02-04 7:20 ` Leo Izen
2024-02-04 9:12 ` Anton Khirnov
2024-02-06 9:00 ` Andreas Rheinhardt
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