[vlc-commits] aout: fix error handling

Rémi Denis-Courmont git at videolan.org
Sun Jul 22 13:34:40 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jul 22 14:34:13 2012 +0300| [54664cc2b5c1926b384ba1f17f3d3583b534e4a2] | committer: Rémi Denis-Courmont

aout: fix error handling

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

 src/audio_output/dec.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/audio_output/dec.c b/src/audio_output/dec.c
index 0bc2e66..2ebc496 100644
--- a/src/audio_output/dec.c
+++ b/src/audio_output/dec.c
@@ -97,10 +97,7 @@ int aout_DecNew( audio_output_t *p_aout,
     vlc_atomic_set (&owner->restart, 0);
     owner->volume = aout_volume_New (p_aout, p_replay_gain);
     if( aout_OutputNew( p_aout, p_format ) < 0 )
-    {
-        ret = -1;
         goto error;
-    }
     aout_volume_SetFormat (owner->volume, owner->mixer_format.i_format);
 
     /* Create the audio filtering "input" pipeline */
@@ -113,11 +110,11 @@ int aout_DecNew( audio_output_t *p_aout,
     if (owner->input == NULL)
     {
         aout_OutputDelete (p_aout);
+error:
         aout_volume_Delete (owner->volume);
-        aout_unlock (p_aout);
-        return -1;
+        owner->volume = NULL;
+        ret = -1;
     }
-error:
     aout_unlock( p_aout );
     return ret;
 }



More information about the vlc-commits mailing list