[FFmpeg-cvslog] avdevice/dshow: fix regression

Diederick Niehorster git at videolan.org
Wed Mar 30 00:26:06 EEST 2022


ffmpeg | branch: master | Diederick Niehorster <dcnieho at gmail.com> | Fri Mar 25 15:10:20 2022 +0100| [f125c504d8fece6420bb97767f9e72414c26312a] | committer: Michael Niedermayer

avdevice/dshow: fix regression

a1c4929f accidentally undid part of d9a9b4c8, so the bug in ticket #9420
resurfaced. Fixing again.

Signed-off-by: Diederick Niehorster <dcnieho at gmail.com>
Reviewed-by: Roger Pack <rogerdpack2 at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f125c504d8fece6420bb97767f9e72414c26312a
---

 libavdevice/dshow.c | 23 ++++++-----------------
 1 file changed, 6 insertions(+), 17 deletions(-)

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 6039578ff9..abb8325bc3 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -1002,23 +1002,12 @@ dshow_cycle_formats(AVFormatContext *avctx, enum dshowDeviceType devtype,
                 );
                 continue;
             }
-            if (requested_sample_rate) {
-                if (requested_sample_rate > acaps->MaximumSampleFrequency ||
-                    requested_sample_rate < acaps->MinimumSampleFrequency)
-                    goto next;
-                fx->nSamplesPerSec = requested_sample_rate;
-            }
-            if (requested_sample_size) {
-                if (requested_sample_size > acaps->MaximumBitsPerSample ||
-                    requested_sample_size < acaps->MinimumBitsPerSample)
-                    goto next;
-                fx->wBitsPerSample = requested_sample_size;
-            }
-            if (requested_channels) {
-                if (requested_channels > acaps->MaximumChannels ||
-                    requested_channels < acaps->MinimumChannels)
-                    goto next;
-                fx->nChannels = requested_channels;
+            if (
+                (ctx->sample_rate && ctx->sample_rate != fx->nSamplesPerSec) ||
+                (ctx->sample_size && ctx->sample_size != fx->wBitsPerSample) ||
+                (ctx->channels    && ctx->channels    != fx->nChannels     )
+            ) {
+                goto next;
             }
         }
 



More information about the ffmpeg-cvslog mailing list