Commit 215e1979 authored by Ramiro Polla's avatar Ramiro Polla Committed by Stefano Sabatini

dshow: invert condition to avoid leaking objects

Signed-off-by: 's avatarStefano Sabatini <stefasab@gmail.com>
parent dd41036a
...@@ -261,7 +261,7 @@ dshow_cycle_devices(AVFormatContext *avctx, ICreateDevEnum *devenum, ...@@ -261,7 +261,7 @@ dshow_cycle_devices(AVFormatContext *avctx, ICreateDevEnum *devenum,
return AVERROR(EIO); 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; IPropertyBag *bag = NULL;
char *buf = NULL; char *buf = NULL;
VARIANT var; VARIANT var;
...@@ -469,7 +469,7 @@ dshow_cycle_pins(AVFormatContext *avctx, enum dshowDeviceType devtype, ...@@ -469,7 +469,7 @@ dshow_cycle_pins(AVFormatContext *avctx, enum dshowDeviceType devtype,
av_log(avctx, AV_LOG_INFO, "DirectShow %s device options\n", av_log(avctx, AV_LOG_INFO, "DirectShow %s device options\n",
devtypename); 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; IKsPropertySet *p = NULL;
IEnumMediaTypes *types = NULL; IEnumMediaTypes *types = NULL;
PIN_INFO info = {0}; PIN_INFO info = {0};
...@@ -508,7 +508,7 @@ dshow_cycle_pins(AVFormatContext *avctx, enum dshowDeviceType devtype, ...@@ -508,7 +508,7 @@ dshow_cycle_pins(AVFormatContext *avctx, enum dshowDeviceType devtype,
goto next; goto next;
IEnumMediaTypes_Reset(types); 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])) { if (IsEqualGUID(&type->majortype, mediatype[devtype])) {
device_pin = pin; device_pin = pin;
goto next; goto next;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment