]> git.sesse.net Git - vlc/blobdiff - src/control/mediacontrol_util.c
test: Move testapi.c to /test and use a sample file that is not ogg for basic testing.
[vlc] / src / control / mediacontrol_util.c
index 03ac81b414f76a0e2d3c85381e95fa906346296c..95ee456c701964f38797c89c42b91875bec5e6e1 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <vlc/mediacontrol.h>
 
 #include <vlc_interface.h>
@@ -84,7 +88,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 +120,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 +268,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 +285,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 );
 }