From: Dan Dennedy Date: Sat, 7 May 2011 03:53:50 +0000 (-0700) Subject: Add mlt_audio_s32le and mlt_audio_f32le audio formats. X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=19de434968890461fc910127749088b72c31e40d;p=mlt Add mlt_audio_s32le and mlt_audio_f32le audio formats. --- diff --git a/src/framework/mlt_frame.c b/src/framework/mlt_frame.c index b67da154..42d23f95 100644 --- a/src/framework/mlt_frame.c +++ b/src/framework/mlt_frame.c @@ -605,7 +605,9 @@ const char * mlt_audio_format_name( mlt_audio_format format ) case mlt_audio_none: return "none"; case mlt_audio_s16: return "s16"; case mlt_audio_s32: return "s32"; + case mlt_audio_s32le: return "s32le"; case mlt_audio_float: return "float"; + case mlt_audio_f32le: return "f32le"; } return "invalid"; } @@ -625,7 +627,9 @@ int mlt_audio_format_size( mlt_audio_format format, int samples, int channels ) { case mlt_audio_none: return 0; case mlt_audio_s16: return samples * channels * sizeof( int16_t ); + case mlt_audio_s32le: case mlt_audio_s32: return samples * channels * sizeof( int32_t ); + case mlt_audio_f32le: case mlt_audio_float: return samples * channels * sizeof( float ); } return 0; @@ -705,6 +709,8 @@ int mlt_frame_get_audio( mlt_frame self, void **buffer, mlt_audio_format *format case mlt_audio_float: size = *samples * *channels * sizeof( float ); break; + default: + break; } if ( size ) *buffer = mlt_pool_alloc( size ); diff --git a/src/framework/mlt_types.h b/src/framework/mlt_types.h index c0ac07c0..50c60e01 100644 --- a/src/framework/mlt_types.h +++ b/src/framework/mlt_types.h @@ -52,7 +52,9 @@ typedef enum mlt_audio_pcm = 1, /**< \deprecated signed 16-bit interleaved PCM */ mlt_audio_s16 = 1, /**< signed 16-bit interleaved PCM */ mlt_audio_s32, /**< signed 32-bit non-interleaved PCM */ - mlt_audio_float /**< 32-bit non-interleaved floating point */ + mlt_audio_float, /**< 32-bit non-interleaved floating point */ + mlt_audio_s32le, /**< signed 32-bit interleaved PCM, may only used by producers */ + mlt_audio_f32le /**< 32-bit interleaved floating point, may only be used by producers */ } mlt_audio_format;