X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fcontrol%2Fmediacontrol_util.c;h=84b56b8d914ad1cbb9b348e04711aa02d1872bce;hb=f297b344ed9a1bf4841c62c5630439cf0e9741fa;hp=70874da20fe41e25f8d58864078443a8fb20ab22;hpb=f85de941b2b2ac1952638ff335dc315c568a431c;p=vlc diff --git a/src/control/mediacontrol_util.c b/src/control/mediacontrol_util.c index 70874da20f..84b56b8d91 100644 --- a/src/control/mediacontrol_util.c +++ b/src/control/mediacontrol_util.c @@ -21,7 +21,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ -#include "mediacontrol_internal.h" #include #include @@ -31,6 +30,7 @@ #include #include +#include "mediacontrol_internal.h" #include /* malloc(), free() */ #include @@ -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 ); }