From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Subject: Re: [FFmpeg-devel] [PATCH] swresample fixes Date: Wed, 4 Jan 2023 18:37:58 +0100 Message-ID: <AS8P250MB074445062B2791D17970F8018FF59@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> (raw) In-Reply-To: <CAPYw7P4-5PPpy_1y_KBQd_Y4ZXq5uyCdqo76Y5h17E8BRemodA@mail.gmail.com> Paul B Mahol: > On Wed, Jan 4, 2023 at 6:26 PM Andreas Rheinhardt < > andreas.rheinhardt@outlook.com> wrote: > >> Paul B Mahol: >>> diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c >>> index 7923377c8c..2744388f75 100644 >>> --- a/libavfilter/af_aresample.c >>> +++ b/libavfilter/af_aresample.c >>> @@ -209,8 +209,14 @@ FF_ENABLE_DEPRECATION_WARNINGS >>> } else { >>> outsamplesref->pts = AV_NOPTS_VALUE; >>> } >>> +again: >>> ret = swr_convert_frame(aresample->swr, outsamplesref, >>> (void *)insamplesref); >>> + if (ret & (AVERROR_INPUT_CHANGED | AVERROR_OUTPUT_CHANGED)) { >> >> This is wrong: There are lots of errors besides AVERROR_INPUT_CHANGED, >> AVERROR_OUTPUT_CHANGED and AVERROR_INPUT_CHANGED | >> AVERROR_OUTPUT_CHANGED for which this condition is true. See also ticket >> #9343. >> > > So what you propose? > The only check way I see to do this is to check for ret == AVERROR_INPUT_CHANGED || ret == AVERROR_OUTPUT_CHANGED || ret == (AVERROR_INPUT_CHANGED | AVERROR_OUTPUT_CHANGED) (the latter value is equal to AVERROR_INPUT_CHANGED). This should be done in the ret < 0 codepath. ("lots of errors" is btw an understatement: All errors are < 0 and therefore have the sign bit set.) > >> >>> + swr_close(aresample->swr); >>> + goto again; >>> + } >>> + >>> if (ret < 0) { >>> av_frame_free(&outsamplesref); >>> av_frame_free(&insamplesref); >> >> _______________________________________________ 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".
next prev parent reply other threads:[~2023-01-04 17:37 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-01-04 16:59 Paul B Mahol 2023-01-04 17:02 ` James Almer 2023-01-04 17:02 ` Andreas Rheinhardt 2023-01-04 17:18 ` Andreas Rheinhardt 2023-01-04 17:25 ` Paul B Mahol 2023-01-04 17:26 ` Andreas Rheinhardt 2023-01-04 17:35 ` Paul B Mahol 2023-01-04 17:37 ` Andreas Rheinhardt [this message] 2023-01-05 20:21 ` Michael Niedermayer 2023-01-05 20:34 ` Michael Niedermayer 2023-01-05 20:44 ` Paul B Mahol 2023-01-05 20:59 ` Michael Niedermayer
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=AS8P250MB074445062B2791D17970F8018FF59@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM \ --to=andreas.rheinhardt@outlook.com \ --cc=ffmpeg-devel@ffmpeg.org \ /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