Commit 5f5a7a23 authored by alex@thinkpad's avatar alex@thinkpad
Browse files

lens_take_picture: wait for file number to change before returning; minor cleanups

--HG--
branch : lua_fix
parent b3a730845550
......@@ -804,10 +804,20 @@ lens_take_picture(
int should_af
)
{
if (ml_taking_pic) return -1;
if (ml_taking_pic)
{
return -1;
}
ml_taking_pic = 1;
if (should_af != AF_DONT_CHANGE) lens_setup_af(should_af);
int file_number_before = get_shooting_card()->file_number;
if (should_af != AF_DONT_CHANGE)
{
lens_setup_af(should_af);
}
//~ take_semaphore(lens_sem, 0);
lens_wait_readytotakepic(64);
......@@ -857,27 +867,45 @@ lens_take_picture(
SW1(0,0);
#endif
end:
end:;
int ret = 0;
if( !wait )
{
//~ give_semaphore(lens_sem);
if (should_af != AF_DONT_CHANGE) lens_cleanup_af();
ml_taking_pic = 0;
return 0;
goto finish;
}
else
{
msleep(200);
if (drive_mode == DRIVE_SELFTIMER_2SEC) msleep(2000);
if (drive_mode == DRIVE_SELFTIMER_REMOTE || drive_mode == DRIVE_SELFTIMER_CONTINUOUS) msleep(10000);
if (drive_mode == DRIVE_SELFTIMER_2SEC)
{
msleep(2000);
}
if (drive_mode == DRIVE_SELFTIMER_REMOTE || drive_mode == DRIVE_SELFTIMER_CONTINUOUS)
{
msleep(10000);
}
lens_wait_readytotakepic(wait);
while (get_shooting_card()->file_number == file_number_before)
{
msleep(50);
}
//~ give_semaphore(lens_sem);
if (should_af != AF_DONT_CHANGE) lens_cleanup_af();
ml_taking_pic = 0;
return lens_info.job_state;
ret = lens_info.job_state;
goto finish;
}
finish:
if (should_af != AF_DONT_CHANGE)
{
lens_cleanup_af();
}
ml_taking_pic = 0;
return ret;
}
#ifdef FEATURE_MOVIE_LOGGING
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment