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: fftools/ffprobe.c: avoid overriding error code.
@ 2022-07-18 20:40 Yubo Xie
  2022-08-16 23:31 ` Stefano Sabatini
  2022-08-16 23:41 ` Stefano Sabatini
  0 siblings, 2 replies; 3+ messages in thread
From: Yubo Xie @ 2022-07-18 20:40 UTC (permalink / raw)
  To: ffmpeg-devel

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

fftools/ffprobe.c: avoid overriding error code.

[-- Attachment #2: 0001-fftools-ffprobe.c-avoid-overriding-error-code.patch --]
[-- Type: application/octet-stream, Size: 1088 bytes --]

[-- 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] 3+ messages in thread

* Re: [FFmpeg-devel] Patch: fftools/ffprobe.c: avoid overriding error code.
  2022-07-18 20:40 [FFmpeg-devel] Patch: fftools/ffprobe.c: avoid overriding error code Yubo Xie
@ 2022-08-16 23:31 ` Stefano Sabatini
  2022-08-16 23:41 ` Stefano Sabatini
  1 sibling, 0 replies; 3+ messages in thread
From: Stefano Sabatini @ 2022-08-16 23:31 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Similar approach as:
[FFmpeg-devel] [PATCH] ffprobe: restore reporting error code for failed inputs

On date Monday 2022-07-18 20:40:03 +0000, Yubo Xie wrote:
> From 7c28459fa1e8d0a375a239257601bb4e47460053 Mon Sep 17 00:00:00 2001
> From: xyb <xyb@xyb.name>
> Date: Mon, 18 Jul 2022 13:31:51 -0700
> Subject: [PATCH] [fftools/ffprobe.c] avoid overriding error code.
> 
> ---
>  fftools/ffprobe.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
> index f156663019..cdd62de696 100644
> --- a/fftools/ffprobe.c
> +++ b/fftools/ffprobe.c
> @@ -4026,7 +4026,7 @@ int main(int argc, char **argv)
>      WriterContext *wctx;
>      char *buf;
>      char *w_name = NULL, *w_args = NULL;
> -    int ret, i;
> +    int ret, i, ret2 = 0;
>  
>      init_dynload();
>  
> @@ -4151,8 +4151,8 @@ int main(int argc, char **argv)
>          }
>  
>          writer_print_section_footer(wctx);
> -        ret = writer_close(&wctx);
> -        if (ret < 0)
> +        ret2 = writer_close(&wctx);
> +        if (ret2 < 0)

>              av_log(NULL, AV_LOG_ERROR, "Writing output failed: %s\n", av_err2str(ret));

ret2

>      }
>  
> @@ -4167,5 +4167,5 @@ end:
>  
>      avformat_network_deinit();
>  
> -    return ret < 0;
> +    return ret < 0 || ret2 < 0;

LGTM otherwise (it's probably better if we just return 1 in case of
failure, no need to propagate the negative error code from the main routine).
_______________________________________________
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] 3+ messages in thread

* Re: [FFmpeg-devel] Patch: fftools/ffprobe.c: avoid overriding error code.
  2022-07-18 20:40 [FFmpeg-devel] Patch: fftools/ffprobe.c: avoid overriding error code Yubo Xie
  2022-08-16 23:31 ` Stefano Sabatini
@ 2022-08-16 23:41 ` Stefano Sabatini
  1 sibling, 0 replies; 3+ messages in thread
From: Stefano Sabatini @ 2022-08-16 23:41 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Related to:
[FFmpeg-devel] [PATCH] ffprobe: restore reporting error code for failed inputs

On date Monday 2022-07-18 20:40:03 +0000, Yubo Xie wrote:
> fftools/ffprobe.c: avoid overriding error code.

> From 7c28459fa1e8d0a375a239257601bb4e47460053 Mon Sep 17 00:00:00 2001
> From: xyb <xyb@xyb.name>
> Date: Mon, 18 Jul 2022 13:31:51 -0700
> Subject: [PATCH] [fftools/ffprobe.c] avoid overriding error code.
> 
> ---
>  fftools/ffprobe.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
> index f156663019..cdd62de696 100644
> --- a/fftools/ffprobe.c
> +++ b/fftools/ffprobe.c
> @@ -4026,7 +4026,7 @@ int main(int argc, char **argv)
>      WriterContext *wctx;
>      char *buf;
>      char *w_name = NULL, *w_args = NULL;
> -    int ret, i;
> +    int ret, i, ret2 = 0;
>  
>      init_dynload();
>  
> @@ -4151,8 +4151,8 @@ int main(int argc, char **argv)
>          }
>  
>          writer_print_section_footer(wctx);
> -        ret = writer_close(&wctx);
> -        if (ret < 0)
> +        ret2 = writer_close(&wctx);

> +        if (ret2 < 0)
>              av_log(NULL, AV_LOG_ERROR, "Writing output failed: %s\n", av_err2str(ret));

ret2

>      }
>  
> @@ -4167,5 +4167,5 @@ end:
>  
>      avformat_network_deinit();
>  
> -    return ret < 0;
> +    return ret < 0 || ret2 < 0;

LGTM otherwise
_______________________________________________
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] 3+ messages in thread

end of thread, other threads:[~2022-08-16 23:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-18 20:40 [FFmpeg-devel] Patch: fftools/ffprobe.c: avoid overriding error code Yubo Xie
2022-08-16 23:31 ` Stefano Sabatini
2022-08-16 23:41 ` Stefano Sabatini

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