Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] avformat/rtpenc: Fix declaration-after-statement warning
@ 2025-03-30 10:09 Andreas Rheinhardt
  2025-03-30 15:03 ` Michael Niedermayer
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Rheinhardt @ 2025-03-30 10:09 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

[-- Attachment #1: Type: text/plain, Size: 237 bytes --]

Patch attached. Will apply it tonight unless there are objections
together with the other declaration-after-statement and unused-variable
patch.
Btw: I see no value in adhering to this ancient C90 rule. Can't we just
drop it?

- Andreas

[-- Attachment #2: 0001-avformat-rtpenc-Fix-declaration-after-statement-warn.patch --]
[-- Type: text/x-patch, Size: 1150 bytes --]

From f8405e877a434ca0b390b5d7f43599cde00a7974 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Sun, 30 Mar 2025 12:06:13 +0200
Subject: [PATCH] avformat/rtpenc: Fix declaration-after-statement warning

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/rtpenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c
index 8b989dca71..77cdd08a44 100644
--- a/libavformat/rtpenc.c
+++ b/libavformat/rtpenc.c
@@ -643,11 +643,11 @@ static int rtp_write_packet(AVFormatContext *s1, AVPacket *pkt)
         break;
     case AV_CODEC_ID_BITPACKED:
     case AV_CODEC_ID_RAWVIDEO: {
+        int interlaced = st->codecpar->field_order != AV_FIELD_PROGRESSIVE;
         if (st->codecpar->width <= 0 || st->codecpar->height <= 0) {
             av_log(s1, AV_LOG_ERROR, "dimensions not set\n");
             return AVERROR(EINVAL);
         }
-        int interlaced = st->codecpar->field_order != AV_FIELD_PROGRESSIVE;
 
         ff_rtp_send_raw_rfc4175(s1, pkt->data, size, interlaced, 0);
         if (interlaced)
-- 
2.45.2


[-- Attachment #3: 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] 2+ messages in thread

* Re: [FFmpeg-devel] [PATCH] avformat/rtpenc: Fix declaration-after-statement warning
  2025-03-30 10:09 [FFmpeg-devel] [PATCH] avformat/rtpenc: Fix declaration-after-statement warning Andreas Rheinhardt
@ 2025-03-30 15:03 ` Michael Niedermayer
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Niedermayer @ 2025-03-30 15:03 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 704 bytes --]

On Sun, Mar 30, 2025 at 12:09:10PM +0200, Andreas Rheinhardt wrote:
> Patch attached. Will apply it tonight unless there are objections
> together with the other declaration-after-statement and unused-variable
> patch.

> Btw: I see no value in adhering to this ancient C90 rule. Can't we just
> drop it?

I would be in favor of droping this rule too.

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

"You are 36 times more likely to die in a bathtub than at the hands of a
terrorist. Also, you are 2.5 times more likely to become a president and
2 times more likely to become an astronaut, than to die in a terrorist
attack." -- Thoughty2


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 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] 2+ messages in thread

end of thread, other threads:[~2025-03-30 15:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-30 10:09 [FFmpeg-devel] [PATCH] avformat/rtpenc: Fix declaration-after-statement warning Andreas Rheinhardt
2025-03-30 15:03 ` Michael Niedermayer

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