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>
This commit is contained in:
Lukasz Marek 2014-04-12 19:05:54 +02:00
parent e89f3d0ed2
commit c1c3c3611e
1 changed files with 2 additions and 0 deletions

View File

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