Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
George Kiagiadakis
gst-plugins-base
Commits
f1e50d1e
Commit
f1e50d1e
authored
Jun 02, 2002
by
Wim Taymans
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correctly calculate time
Original commit message from CVS: Correctly calculate time
parent
d22b3522
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
11 deletions
+15
-11
testsuite/seeking/seek1.c
testsuite/seeking/seek1.c
+15
-11
No files found.
testsuite/seeking/seek1.c
View file @
f1e50d1e
...
...
@@ -286,11 +286,15 @@ static gchar*
format_value
(
GtkScale
*
scale
,
gdouble
value
)
{
gint
real
=
value
*
duration
/
100
;
gint
seconds
=
(
gint
)
real
/
1000000
;
gint
subseconds
=
(
gint
)
real
/
10000
;
gint
64
real
;
gint
64
seconds
;
gint
64
subseconds
;
return
g_strdup_printf
(
"%02d:%02d:%02d"
,
real
=
value
*
duration
/
100
;
seconds
=
(
gint64
)
real
/
GST_SECOND
;
subseconds
=
(
gint64
)
real
/
(
GST_SECOND
/
10
);
return
g_strdup_printf
(
"%02lld:%02lld:%02lld"
,
seconds
/
60
,
seconds
%
60
,
subseconds
%
100
);
...
...
@@ -331,10 +335,10 @@ query_rates (void)
if
(
gst_pad_convert
(
pad
,
GST_FORMAT_TIME
,
GST_SECOND
,
&
format
,
&
value
))
{
g_print
(
"%s %1
0
lld | "
,
seek_formats
[
i
].
name
,
value
);
g_print
(
"%s %1
3
lld | "
,
seek_formats
[
i
].
name
,
value
);
}
else
{
g_print
(
"%s %1
0
.1
0
s | "
,
seek_formats
[
i
].
name
,
"*NA*"
);
g_print
(
"%s %1
3
.1
3
s | "
,
seek_formats
[
i
].
name
,
"*NA*"
);
}
i
++
;
...
...
@@ -359,12 +363,12 @@ query_durations (GstPad *pad)
format
=
seek_formats
[
i
].
format
;
res
=
gst_pad_query
(
pad
,
GST_PAD_QUERY_TOTAL
,
&
format
,
&
value
);
if
(
res
)
{
g_print
(
"%s %1
0
lld | "
,
seek_formats
[
i
].
name
,
value
);
g_print
(
"%s %1
3
lld | "
,
seek_formats
[
i
].
name
,
value
);
if
(
seek_formats
[
i
].
format
==
GST_FORMAT_TIME
)
duration
=
value
;
}
else
{
g_print
(
"%s %1
0
.1
0
s | "
,
seek_formats
[
i
].
name
,
"*NA*"
);
g_print
(
"%s %1
3
.1
3
s | "
,
seek_formats
[
i
].
name
,
"*NA*"
);
}
i
++
;
}
...
...
@@ -385,12 +389,12 @@ query_positions (GstPad *pad)
format
=
seek_formats
[
i
].
format
;
res
=
gst_pad_query
(
pad
,
GST_PAD_QUERY_POSITION
,
&
format
,
&
value
);
if
(
res
)
{
g_print
(
"%s %1
0
lld | "
,
seek_formats
[
i
].
name
,
value
);
g_print
(
"%s %1
3
lld | "
,
seek_formats
[
i
].
name
,
value
);
if
(
seek_formats
[
i
].
format
==
GST_FORMAT_TIME
)
position
=
value
;
}
else
{
g_print
(
"%s %1
0
.1
0
s | "
,
seek_formats
[
i
].
name
,
"*NA*"
);
g_print
(
"%s %1
3
.1
3
s | "
,
seek_formats
[
i
].
name
,
"*NA*"
);
}
i
++
;
}
...
...
@@ -405,7 +409,7 @@ update_scale (gpointer data)
clock
=
gst_bin_get_clock
(
GST_BIN
(
pipeline
));
g_print
(
"clock: %1
0
llu (%s)
\n
"
,
gst_clock_get_time
(
clock
),
gst_object_get_name
(
GST_OBJECT
(
clock
)));
g_print
(
"clock: %1
3
llu (%s)
\n
"
,
gst_clock_get_time
(
clock
),
gst_object_get_name
(
GST_OBJECT
(
clock
)));
while
(
walk
)
{
GstPad
*
pad
=
GST_PAD
(
walk
->
data
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment