1.第一次DOWN完版本,进入CAMCORDER,拍照的时候照片命名及序号会从1开始,如IMG00001.jpg。拍了5张照片,从01——05;
2.然后进入FILE MANAGER把IMG00004.jpg、IMG00005.jpg分别重命名为IMG00007.jpg、IMG00008.jpg;
3.再次进入CAMCORDER,拍几张照片,发现新拍照片名字依次为:IMG00006.jpg、IMG00008.jpg、IMG00009.jpg;
4.查看发现原本从IMG00005.jpg为IMG00008.jpg的这张照片被新的内容覆盖了。
[SOLUTION]
mmi_camco_cam_get_next_filename()
{
if (is_binary_search)
{
last_file_exist_num = filename_seq_no;//添加此语句
left = filename_seq_no + 1;
right = CAMCO_MAX_FILE_NUM;
把
while (left < right)
改为 while (left <= right)
{
。。
if (file_handle >= 0)
{
/* file exist */
//添加以下代码 if(left == right)
{
mid = left + 1;
WriteValue(NVRAM_CAM_FILENAME_SEQ_NO, &mid, DS_SHORT, &error);
MMI_TRACE(MMI_MEDIA_TRC_G2_APP, MMI_TRC_CAMCO_FILE_NAME_WRITE_MID, mid);
sprintf( buffer, "IMG%05d", mid);
mmi_asc_to_ucs2( ucs2_buffer, buffer);
mmi_ucs2cpy(ucs2_testname,ucs2_buffer);
#ifdef __MMI_CAMCO_FEATURE_CAM_MULTI_ANGLE_VIEW_SHOT__
if(mmi_camco_setting_get_setting_value(MMI_CAMCO_SETTING_CAPMODE)==MMI_CAMCO_CAP
MODE_MAV)
{
mmi_ucs2cat(ucs2_testname, (const CHAR*) L".mav");
}
else
#endif
{
mmi_ucs2cat(ucs2_testname, (const CHAR*) L".jpg");
}
mmi_ucs2cpy( filepath_buf_p, mmi_camco_cam_p->storage_filepath_p);
mmi_ucs2cat( filepath_buf_p, ucs2_testname);
return;
}
else
//添加以上代码
{
left = mid + 1;
last_file_exist_num = mid;
}
}
...
}
把
if (right <= left)
改为 if (right < left)
{
...
}
}
2.然后进入FILE MANAGER把IMG00004.jpg、IMG00005.jpg分别重命名为IMG00007.jpg、IMG00008.jpg;
3.再次进入CAMCORDER,拍几张照片,发现新拍照片名字依次为:IMG00006.jpg、IMG00008.jpg、IMG00009.jpg;
4.查看发现原本从IMG00005.jpg为IMG00008.jpg的这张照片被新的内容覆盖了。
[SOLUTION]
mmi_camco_cam_get_next_filename()
{
if (is_binary_search)
{
last_file_exist_num = filename_seq_no;//添加此语句
left = filename_seq_no + 1;
right = CAMCO_MAX_FILE_NUM;
把
while (left < right)
改为 while (left <= right)
{
。。
if (file_handle >= 0)
{
/* file exist */
//添加以下代码 if(left == right)
{
mid = left + 1;
WriteValue(NVRAM_CAM_FILENAME_SEQ_NO, &mid, DS_SHORT, &error);
MMI_TRACE(MMI_MEDIA_TRC_G2_APP, MMI_TRC_CAMCO_FILE_NAME_WRITE_MID, mid);
sprintf( buffer, "IMG%05d", mid);
mmi_asc_to_ucs2( ucs2_buffer, buffer);
mmi_ucs2cpy(ucs2_testname,ucs2_buffer);
#ifdef __MMI_CAMCO_FEATURE_CAM_MULTI_ANGLE_VIEW_SHOT__
if(mmi_camco_setting_get_setting_value(MMI_CAMCO_SETTING_CAPMODE)==MMI_CAMCO_CAP
MODE_MAV)
{
mmi_ucs2cat(ucs2_testname, (const CHAR*) L".mav");
}
else
#endif
{
mmi_ucs2cat(ucs2_testname, (const CHAR*) L".jpg");
}
mmi_ucs2cpy( filepath_buf_p, mmi_camco_cam_p->storage_filepath_p);
mmi_ucs2cat( filepath_buf_p, ucs2_testname);
return;
}
else
//添加以上代码
{
left = mid + 1;
last_file_exist_num = mid;
}
}
...
}
把
if (right <= left)
改为 if (right < left)
{
...
}
}