int *codechandle, char *stream_type, int stream_index)
{
mmsound_mgr_codec_param_t param = {0,};
- MMSourceType *source = NULL;
int ret = MM_ERROR_NONE;
- /* Set source */
- source = (MMSourceType*)malloc(sizeof(MMSourceType));
- if (!source) {
- debug_error("malloc fail!!\n");
- return MM_ERROR_OUT_OF_MEMORY;
- }
-
- ret = mm_source_open_file(filename, source, MM_SOURCE_CHECK_DRM_CONTENTS);
- if(ret != MM_ERROR_NONE) {
- debug_error("Fail to open file\n");
- if (source) {
- free(source);
- }
- return ret;
- }
-
/* Set sound player parameter */
param.tone = tone;
param.repeat_count = repeat;
param.session_type = session_type;
param.session_options = session_options;
param.param = (void*)client_pid;
- param.source = source;
+ param.pfilename = filename;
param.enable_session = enable_session;
param.stream_index = stream_index;
MMSOUND_STRNCPY(param.stream_type, stream_type, MM_SOUND_STREAM_TYPE_LEN);
ret = MMSoundMgrCodecPlay(codechandle, ¶m);
if (ret != MM_ERROR_NONE) {
debug_error("Will be closed a sources, codechandle : 0x%08X\n", *codechandle);
- mm_source_close(source);
- if (source) {
- free(source);
- source = NULL;
- }
return ret;
}
}
#endif
-int _MMSoundMgrIpcPlayFileWithStreamInfo(char* filename, int repeat, int volume,
+int _MMSoundMgrIpcPlayFileWithStreamInfo(char *filename, int repeat, int volume,
int client_pid, int *codechandle, char *stream_type, int stream_index)
{
mmsound_mgr_codec_param_t param = {0,};
- MMSourceType *source = NULL;
int ret = MM_ERROR_NONE;
- /* Set source */
- source = (MMSourceType*)malloc(sizeof(MMSourceType));
- if (!source) {
- debug_error("malloc fail!!\n");
- return MM_ERROR_OUT_OF_MEMORY;
- }
-
- ret = mm_source_open_file(filename, source, MM_SOURCE_CHECK_DRM_CONTENTS);
- if(ret != MM_ERROR_NONE) {
- debug_error("Fail to open file\n");
- if (source) {
- free(source);
- }
- return ret;
- }
-
/* Set sound player parameter */
param.repeat_count = repeat;
param.volume = volume;
param.param = (void*)client_pid;
- param.source = source;
+ param.pfilename = filename;
param.stream_index = stream_index;
MMSOUND_STRNCPY(param.stream_type, stream_type, MM_SOUND_STREAM_TYPE_LEN);
ret = MMSoundMgrCodecPlayWithStreamInfo(codechandle, ¶m);
if (ret != MM_ERROR_NONE) {
debug_error("Will be closed a sources, codechandle : 0x%08X\n", *codechandle);
- mm_source_close(source);
- if (source) {
- free(source);
- source = NULL;
- }
return ret;
}