Commit ce1d77a5 authored by Felix Matouschek's avatar Felix Matouschek Committed by Timo Rothenpieler

lavd: fix iterating of input and output devices

In the previous implementation the first input or output device
was skipped when device_next was called with prev = NULL
Signed-off-by: 's avatarFelix Matouschek <felix@matouschek.org>
Signed-off-by: 's avatarTimo Rothenpieler <timo@rothenpieler.org>
parent 3e7fa34d
...@@ -126,16 +126,13 @@ static void *device_next(void *prev, int output, ...@@ -126,16 +126,13 @@ static void *device_next(void *prev, int output,
ff_thread_once(&av_device_next_init, av_device_init_next); ff_thread_once(&av_device_next_init, av_device_init_next);
if (!prev && !(prev = (output ? (void*)outdev_list[0] : (void*)indev_list[0])))
return NULL;
do { do {
if (output) { if (output) {
if (!(prev = ((AVOutputFormat *)prev)->next)) if (!(prev = prev ? ((AVOutputFormat *)prev)->next : (void*)outdev_list[0]))
break; break;
pc = ((AVOutputFormat *)prev)->priv_class; pc = ((AVOutputFormat *)prev)->priv_class;
} else { } else {
if (!(prev = ((AVInputFormat *)prev)->next)) if (!(prev = prev ? ((AVInputFormat *)prev)->next : (void*)indev_list[0]))
break; break;
pc = ((AVInputFormat *)prev)->priv_class; pc = ((AVInputFormat *)prev)->priv_class;
} }
......
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