[DESCRIPTION]
请检查makefile中的宏值是否和下面一致:
MEDIA_PLAYER_VER = INTEGRATED
如果一致,如下操作即可复现问题:
Menu->Multimedia->Media player->My playlists->Select a list->Options-Open,然后选择手机或者T卡中的一首歌,添加到该列表(或者通过主菜单all multimedia files下的 addto 菜单添加某首歌曲到某个播放列表下)。之后再添加这首歌到同一播放列表中,没有file already exists等提示,依然可以继续添加同一首歌曲到同一个播放列表中。 .
[SOLUTION]来自半导体社群
代码原有设计中,是直接将待添加的歌曲信息写到playlist文件中,没有提供同名歌曲检查功能。如果需要添加此功能,请按如下方式修改代码:
S32 mmi_medply_plst_generate_append_internal(UI_string_type path, MMI_BOOL is_short, MMI_BOOL
write_back_file_immediately)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U32 write_size = 0;
U32 insert_offset = 0;
U32 search_offset=0; //add
U16 j=0; //add
......
else
{
if (browser_now_playing)
{
list = &(plst_cntx_p->current_list);
}
else
{
list = plst_cntx_p->browser_list_p;
}
}
//add
{
for(i=0;i< list->total;i++)
{
search_offset = list->header.index[i].offset;
next_block = search_offset;
for (j = 0; j< list->header.index[i].used_block; j++)
{
ret = FS_Seek(list->fs_hdlr, next_block, FS_FILE_BEGIN);
if (ret < FS_NO_ERROR)
{
break;
}
search_offset = next_block;
ret = FS_Read(list->fs_hdlr, &block, sizeof(mmi_medply_plst_block_node_struct), &write_size);
if (ret < FS_NO_ERROR)
{
break;
}
else if (write_size != sizeof(mmi_medply_plst_block_node_struct))
{
ret = MEDPLY_PLST_ERR_READ_FAILED;
break;
}
if (block.pattern_begin != MEDPLY_PLAYLIST_BLOCK_PATTERN_1 ||
block.pattern_end != MEDPLY_PLAYLIST_BLOCK_PATTERN_2)
{
ret = MEDPLY_PLST_ERR_LIST_DAMAGED;
break;
}
next_block = block.next_ptr;
if (!next_block && (j < list->header.index[i].used_block -1))
{
ret = MEDPLY_PLST_ERR_LIST_DAMAGED;
break;
}
memcpy(&(path_buff[j * MMI_MEDPLY_BLOCK_DATA_SIZE]), &(block.data),
MMI_MEDPLY_BLOCK_DATA_SIZE);
if (j == list->header.index[i].used_block -1)
{
block.next_ptr = 0;
}
}
if (!mmi_ucs2nicmp((CHAR*)path_buff,
(CHAR*)path, (U32)mmi_ucs2strlen((CHAR*)path)))
{
ret = FS_FILE_EXISTS;
break;
}
}
if (ret < FS_NO_ERROR)
{
return ret;
}
memset(path_buff, 0, MEDPLY_MAX_PATH_SIZE);
}
// add
memset(&new_node, 0, sizeof(mmi_medply_plst_index_node_struct));
new_node.offset = list->header.footer_pattern_offset;
new_node.index = list->total;
.......