lavd: no default device unless explicitly set

AVDeviceInfoList was allocated with first device set as default
even though there is no device after allocation.

Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
pull/64/merge
Lukasz Marek 11 years ago
parent e89f3d0ed2
commit c1c3c3611e
  1. 2
      libavdevice/avdevice.c

@ -194,6 +194,8 @@ int avdevice_list_devices(AVFormatContext *s, AVDeviceInfoList **device_list)
*device_list = av_mallocz(sizeof(AVDeviceInfoList));
if (!(*device_list))
return AVERROR(ENOMEM);
/* no default device by default */
(*device_list)->default_device = -1;
if (s->oformat)
ret = s->oformat->get_device_list(s, *device_list);
else

Loading…
Cancel
Save