Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gst-plugins-good
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
George Kiagiadakis
gst-plugins-good
Commits
4053e1d6
Commit
4053e1d6
authored
Jun 30, 2013
by
Matej Knopp
Committed by
Sebastian Dröge
Jul 01, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qtdemux: compute framerate from average sample duration
https://bugzilla.gnome.org/show_bug.cgi?id=703350
parent
97015d3c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
gst/isomp4/Makefile.am
gst/isomp4/Makefile.am
+1
-1
gst/isomp4/qtdemux.c
gst/isomp4/qtdemux.c
+15
-4
No files found.
gst/isomp4/Makefile.am
View file @
4053e1d6
...
...
@@ -10,7 +10,7 @@ libgstisomp4_la_LIBADD = \
-lgstrtp-
@GST_API_VERSION@
\
-lgsttag-
@GST_API_VERSION@
\
-lgstpbutils-
@GST_API_VERSION@
\
$(GST_BASE_LIBS)
$(GST_LIBS)
$(ZLIB_LIBS)
$(GST_BASE_LIBS)
$(GST_LIBS)
$(ZLIB_LIBS)
$(LIBM)
libgstisomp4_la_LDFLAGS
=
${GST_PLUGIN_LDFLAGS}
libgstisomp4_la_SOURCES
=
isomp4-plugin.c gstrtpxqtdepay.c
\
qtdemux.c qtdemux_types.c qtdemux_dump.c qtdemux_lang.c
\
...
...
gst/isomp4/qtdemux.c
View file @
4053e1d6
...
...
@@ -70,6 +70,9 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <gst/math-compat.h>
#ifdef HAVE_ZLIB
# include <zlib.h>
#endif
...
...
@@ -5528,11 +5531,19 @@ gst_qtdemux_configure_stream (GstQTDemux * qtdemux, QtDemuxStream * stream)
stream
->
fps_n
=
0
;
stream
->
fps_d
=
1
;
}
else
{
stream
->
fps_n
=
stream
->
timescale
;
if
(
stream
->
min_duration
==
0
)
stream
->
fps_d
=
1
;
/* we might need to scale the timescale to get precise framerate */
const
int
required_scale
=
rint
(
log
(
10000
)
/
2
.
303
);
/* divide to get log10 */
int
current_scale
=
rint
(
log
(
stream
->
timescale
)
/
2
.
303
);
int
factor
=
pow
(
10
.
0
,
MAX
(
0
,
required_scale
-
current_scale
));
stream
->
fps_n
=
stream
->
timescale
*
factor
;
if
(
stream
->
duration
==
0
)
stream
->
fps_d
=
factor
;
else
stream
->
fps_d
=
stream
->
min_duration
;
stream
->
fps_d
=
gst_util_uint64_scale_int_round
(
factor
,
stream
->
duration
,
stream
->
n_samples
);
}
if
(
stream
->
caps
)
{
...
...
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