]> git.sesse.net Git - vlc/blobdiff - src/control/mediacontrol_util.c
Reference count libvlc. API break.
[vlc] / src / control / mediacontrol_util.c
index 70874da20fe41e25f8d58864078443a8fb20ab22..84b56b8d914ad1cbb9b348e04711aa02d1872bce 100644 (file)
@@ -21,7 +21,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#include "mediacontrol_internal.h"
 #include <vlc/mediacontrol.h>
 
 #include <vlc_interface.h>
@@ -31,6 +30,7 @@
 
 #include <vlc_vout.h>
 #include <vlc_osd.h>
+#include "mediacontrol_internal.h"
 
 #include <stdlib.h>                                      /* malloc(), free() */
 #include <string.h>
@@ -84,7 +84,7 @@ vlc_int64_t private_mediacontrol_unit_convert( input_thread_t *p_input,
                 return( value * f_fps / 1000.0 );
         }
         /* Cannot happen */
-        /* See http://catb.org/~esr/jargon/html/entry/can't-happen.html */
+        /* See http://catb.org/~esr/jargon/html/entry/can-t-happen.html */
         break;
 
     case mediacontrol_SampleCount:
@@ -116,14 +116,14 @@ vlc_int64_t private_mediacontrol_unit_convert( input_thread_t *p_input,
 
 //         if( p_input->stream.i_mux_rate == 0 )
 //             return 0;
-// 
+//
 //         /* Convert an offset into milliseconds. Taken from input_ext-intf.c.
 //            The 50 hardcoded constant comes from the definition of i_mux_rate :
 //            i_mux_rate : the rate we read the stream (in units of 50 bytes/s) ;
 //            0 if undef */
 //         if( to == mediacontrol_MediaTime )
 //             return ( vlc_int64_t )( 1000 * value / 50 / p_input->stream.i_mux_rate );
-// 
+//
 //         if( to == mediacontrol_SampleCount )
 //         {
 //             double f_fps;
@@ -264,7 +264,7 @@ mediacontrol_Exception*
 mediacontrol_exception_create( void )
 {
     mediacontrol_Exception* exception;
-    
     exception = ( mediacontrol_Exception* )malloc( sizeof( mediacontrol_Exception ) );
     mediacontrol_exception_init( exception );
     return exception;
@@ -281,12 +281,16 @@ mediacontrol_exception_init( mediacontrol_Exception *exception )
 }
 
 void
-mediacontrol_exception_free( mediacontrol_Exception *exception )
+mediacontrol_exception_cleanup( mediacontrol_Exception *exception )
 {
-    if( ! exception )
-        return;
+    if( exception )
+        free( exception->message );
+}
 
-    free( exception->message );
+void
+mediacontrol_exception_free( mediacontrol_Exception *exception )
+{
+    mediacontrol_exception_cleanup( exception );
     free( exception );
 }