[vlc-commits] aout: move assert after the error check

Thomas Guillem git at videolan.org
Fri Oct 25 09:30:21 CEST 2019


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Oct 24 16:11:48 2019 +0200| [1ae711934f07e40e5165949642ba3999fa375435] | committer: Thomas Guillem

aout: move assert after the error check

This fixes an invalid assert when the module failed to start.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1ae711934f07e40e5165949642ba3999fa375435
---

 src/audio_output/output.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/audio_output/output.c b/src/audio_output/output.c
index 21b02d7898..fe782d6e1d 100644
--- a/src/audio_output/output.c
+++ b/src/audio_output/output.c
@@ -602,13 +602,13 @@ int aout_OutputNew (audio_output_t *aout)
         filter_fmt->i_format = fmt->i_format = formats[i];
         ret = aout->start(aout, fmt);
     }
-    assert(aout->flush && aout->play && aout->time_get && aout->pause);
     vlc_mutex_unlock(&owner->lock);
     if (ret)
     {
         msg_Err (aout, "module not functional");
         return -1;
     }
+    assert(aout->flush && aout->play && aout->time_get && aout->pause);
 
     aout_PrepareStereoMode (aout, fmt, filters_cfg, input_chan_type,
                             i_nb_input_channels);



More information about the vlc-commits mailing list