Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
a414b9b9
Commit
a414b9b9
authored
14 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
[#3218] Use static gchar array for timestr to store elapsed time
parent
0f629424
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sflphone-client-gnome/src/callable_obj.c
+14
-19
14 additions, 19 deletions
sflphone-client-gnome/src/callable_obj.c
sflphone-client-gnome/src/callable_obj.h
+1
-1
1 addition, 1 deletion
sflphone-client-gnome/src/callable_obj.h
with
15 additions
and
20 deletions
sflphone-client-gnome/src/callable_obj.c
+
14
−
19
View file @
a414b9b9
...
...
@@ -135,8 +135,6 @@ void *threaded_clock_incrementer(void *pc) {
while
(
call
->
clockStarted
)
{
DEBUG
(
"CLOCK STARTED: %d"
,
call
->
clockStarted
);
gchar
*
res
;
int
duration
;
time_t
start
,
current
;
...
...
@@ -147,32 +145,29 @@ void *threaded_clock_incrementer(void *pc) {
current
=
call
->
_time_current
;
if
(
current
==
start
)
{
// DEBUG("<small>Duration:</small> 0:00");
call
->
_timestr
=
g_strdup_printf
(
"00:00"
);
// g_markup_printf_escaped("00:00");
g_snprintf
(
call
->
_timestr
,
20
,
"00:00"
);
}
duration
=
(
int
)
difftime
(
current
,
start
);
if
(
duration
/
60
==
0
)
{
if
(
duration
<
10
)
call
->
_timestr
=
g_strdup_printf
(
"00:0%d"
,
duration
);
// g_markup_printf_escaped("00:0%d", duration);
else
call
->
_timestr
=
g_strdup_printf
(
"00:%d"
,
duration
);
// g_markup_printf_escaped("00:%d", duration);
if
(
duration
<
10
)
{
g_snprintf
(
call
->
_timestr
,
20
,
"00:0%d"
,
duration
);
}
else
{
g_snprintf
(
call
->
_timestr
,
20
,
"00:%d"
,
duration
);
}
}
else
{
if
(
duration
%
60
<
10
)
call
->
_timestr
=
g_strdup_printf
(
"0%d:0%d"
,
duration
/
60
,
duration
%
60
);
// g_markup_printf_escaped("0%d:0%d" , duration/60 , duration%60);
else
call
->
_timestr
=
g_strdup_printf
(
"%d:%d"
,
duration
/
60
,
duration
%
60
);
// g_markup_printf_escaped("%d:%d" , duration/60 , duration%60);
if
(
duration
%
60
<
10
)
{
g_snprintf
(
call
->
_timestr
,
20
,
"0%d:0%d"
,
duration
/
60
,
duration
%
60
);
}
else
{
g_snprintf
(
call
->
_timestr
,
20
,
"%d:%d"
,
duration
/
60
,
duration
%
60
);
}
}
// return g_markup_printf_escaped("<small>Duration:</small> %s", res);
// call->_timestr = res;
// DEBUG("PRINT THE CLOCK")
// DEBUG("CLOCK %s", call->_timestr);
calltree_update_clock
();
...
...
@@ -205,7 +200,7 @@ void create_new_call (callable_type_t type, call_state_t state, gchar* callID ,
set_timestamp
(
&
(
obj
->
_time_start
));
set_timestamp
(
&
(
obj
->
_time_current
));
set_timestamp
(
&
(
obj
->
_time_stop
));
obj
->
_timestr
=
NULL
;
g_snprintf
(
obj
->
_timestr
,
20
,
"00:00"
)
;
if
(
g_strcasecmp
(
callID
,
""
)
==
0
)
call_id
=
generate_call_id
();
...
...
This diff is collapsed.
Click to expand it.
sflphone-client-gnome/src/callable_obj.h
+
1
−
1
View file @
a414b9b9
...
...
@@ -112,7 +112,7 @@ typedef struct {
time_t
_time_start
;
// The timestamp the call was initiating
time_t
_time_current
;
// Clock increment to display call's elapsed time
time_t
_time_stop
;
// The timestamp the call was over
gchar
*
_timestr
;
// The timestamp as a string format for
gchar
_timestr
[
20
]
;
// The timestamp as a string format for
history_state_t
_history_state
;
// The history state if necessary
srtp_state_t
_srtp_state
;
// The state of security on the call
gchar
*
_srtp_cipher
;
// Cipher used for the srtp session
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment