Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
bc7d0517
Commit
bc7d0517
authored
Jan 13, 2012
by
Martin Storsjö
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
movdec: Calculate an average bit rate for fragmented streams, too
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
3b5d4428
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
isom.h
libavformat/isom.h
+1
-0
mov.c
libavformat/mov.c
+14
-1
No files found.
libavformat/isom.h
View file @
bc7d0517
...
...
@@ -125,6 +125,7 @@ typedef struct MOVStreamContext {
int
dts_shift
;
///< dts shift when ctts is negative
uint32_t
palette
[
256
];
int
has_palette
;
int64_t
data_size
;
}
MOVStreamContext
;
typedef
struct
MOVContext
{
...
...
libavformat/mov.c
View file @
bc7d0517
...
...
@@ -1580,8 +1580,10 @@ static int mov_read_stsz(MOVContext *c, AVIOContext *pb, MOVAtom atom)
init_get_bits
(
&
gb
,
buf
,
8
*
num_bytes
);
for
(
i
=
0
;
i
<
entries
;
i
++
)
for
(
i
=
0
;
i
<
entries
;
i
++
)
{
sc
->
sample_sizes
[
i
]
=
get_bits_long
(
&
gb
,
field_size
);
sc
->
data_size
+=
sc
->
sample_sizes
[
i
];
}
av_free
(
buf
);
return
0
;
...
...
@@ -2258,6 +2260,7 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
distance
++
;
dts
+=
sample_duration
;
offset
+=
sample_size
;
sc
->
data_size
+=
sample_size
;
}
frag
->
moof_offset
=
offset
;
st
->
duration
=
dts
+
sc
->
time_offset
;
...
...
@@ -2576,6 +2579,16 @@ static int mov_read_header(AVFormatContext *s, AVFormatParameters *ap)
if
(
pb
->
seekable
&&
mov
->
chapter_track
>
0
)
mov_read_chapters
(
s
);
if
(
mov
->
trex_data
)
{
int
i
;
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
{
AVStream
*
st
=
s
->
streams
[
i
];
MOVStreamContext
*
sc
=
st
->
priv_data
;
if
(
st
->
duration
)
st
->
codec
->
bit_rate
=
sc
->
data_size
*
8
*
sc
->
time_scale
/
st
->
duration
;
}
}
return
0
;
}
...
...
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