[FFmpeg-cvslog] dshow: invert condition to avoid leaking objects

Ramiro Polla git at videolan.org
Fri Sep 16 11:18:20 CEST 2011


ffmpeg | branch: master | Ramiro Polla <ramiro.polla at gmail.com> | Fri Sep  9 00:16:17 2011 -0300| [215e197942e33d5c5749d786e938bf7abe856c1d] | committer: Stefano Sabatini

dshow: invert condition to avoid leaking objects

Signed-off-by: Stefano Sabatini <stefasab at gmail.com>

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

 libavdevice/dshow.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 5f155e6..8dc9df9 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -261,7 +261,7 @@ dshow_cycle_devices(AVFormatContext *avctx, ICreateDevEnum *devenum,
         return AVERROR(EIO);
     }
 
-    while (IEnumMoniker_Next(classenum, 1, &m, NULL) == S_OK && !device_filter) {
+    while (!device_filter && IEnumMoniker_Next(classenum, 1, &m, NULL) == S_OK) {
         IPropertyBag *bag = NULL;
         char *buf = NULL;
         VARIANT var;
@@ -469,7 +469,7 @@ dshow_cycle_pins(AVFormatContext *avctx, enum dshowDeviceType devtype,
         av_log(avctx, AV_LOG_INFO, "DirectShow %s device options\n",
                devtypename);
     }
-    while (IEnumPins_Next(pins, 1, &pin, NULL) == S_OK && !device_pin) {
+    while (!device_pin && IEnumPins_Next(pins, 1, &pin, NULL) == S_OK) {
         IKsPropertySet *p = NULL;
         IEnumMediaTypes *types = NULL;
         PIN_INFO info = {0};
@@ -508,7 +508,7 @@ dshow_cycle_pins(AVFormatContext *avctx, enum dshowDeviceType devtype,
             goto next;
 
         IEnumMediaTypes_Reset(types);
-        while (IEnumMediaTypes_Next(types, 1, &type, NULL) == S_OK && !device_pin) {
+        while (!device_pin && IEnumMediaTypes_Next(types, 1, &type, NULL) == S_OK) {
             if (IsEqualGUID(&type->majortype, mediatype[devtype])) {
                 device_pin = pin;
                 goto next;



More information about the ffmpeg-cvslog mailing list