Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
a351110e
Commit
a351110e
authored
Feb 05, 2011
by
Reimar Döffinger
Committed by
Ronald S. Bultje
Feb 06, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always use av_set_pts_info to set the stream time base.
Signed-off-by:
Ronald S. Bultje
<
rsbultje@gmail.com
>
parent
ed19fafd
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
12 additions
and
16 deletions
+12
-16
c93.c
libavformat/c93.c
+1
-1
oggparsedirac.c
libavformat/oggparsedirac.c
+2
-3
oggparseflac.c
libavformat/oggparseflac.c
+1
-2
oggparseogm.c
libavformat/oggparseogm.c
+2
-3
oggparseskeleton.c
libavformat/oggparseskeleton.c
+3
-2
oggparsespeex.c
libavformat/oggparsespeex.c
+1
-2
oggparsetheora.c
libavformat/oggparsetheora.c
+1
-1
oggparsevorbis.c
libavformat/oggparsevorbis.c
+1
-2
No files found.
libavformat/c93.c
View file @
a351110e
...
@@ -89,7 +89,7 @@ static int read_header(AVFormatContext *s,
...
@@ -89,7 +89,7 @@ static int read_header(AVFormatContext *s,
video
->
codec
->
height
=
192
;
video
->
codec
->
height
=
192
;
/* 4:3 320x200 with 8 empty lines */
/* 4:3 320x200 with 8 empty lines */
video
->
sample_aspect_ratio
=
(
AVRational
)
{
5
,
6
};
video
->
sample_aspect_ratio
=
(
AVRational
)
{
5
,
6
};
video
->
time_base
=
(
AVRational
)
{
2
,
25
}
;
av_set_pts_info
(
video
,
64
,
2
,
25
)
;
video
->
nb_frames
=
framecount
;
video
->
nb_frames
=
framecount
;
video
->
duration
=
framecount
;
video
->
duration
=
framecount
;
video
->
start_time
=
0
;
video
->
start_time
=
0
;
...
...
libavformat/oggparsedirac.c
View file @
a351110e
...
@@ -42,7 +42,7 @@ static int dirac_header(AVFormatContext *s, int idx)
...
@@ -42,7 +42,7 @@ static int dirac_header(AVFormatContext *s, int idx)
st
->
codec
->
codec_type
=
AVMEDIA_TYPE_VIDEO
;
st
->
codec
->
codec_type
=
AVMEDIA_TYPE_VIDEO
;
st
->
codec
->
codec_id
=
CODEC_ID_DIRAC
;
st
->
codec
->
codec_id
=
CODEC_ID_DIRAC
;
// dirac in ogg always stores timestamps as though the video were interlaced
// dirac in ogg always stores timestamps as though the video were interlaced
st
->
time_base
=
(
AVRational
){
st
->
codec
->
time_base
.
num
,
2
*
st
->
codec
->
time_base
.
den
}
;
av_set_pts_info
(
st
,
64
,
st
->
codec
->
time_base
.
num
,
2
*
st
->
codec
->
time_base
.
den
)
;
return
1
;
return
1
;
}
}
...
@@ -79,8 +79,7 @@ static int old_dirac_header(AVFormatContext *s, int idx)
...
@@ -79,8 +79,7 @@ static int old_dirac_header(AVFormatContext *s, int idx)
st
->
codec
->
codec_type
=
AVMEDIA_TYPE_VIDEO
;
st
->
codec
->
codec_type
=
AVMEDIA_TYPE_VIDEO
;
st
->
codec
->
codec_id
=
CODEC_ID_DIRAC
;
st
->
codec
->
codec_id
=
CODEC_ID_DIRAC
;
st
->
time_base
.
den
=
AV_RB32
(
buf
+
8
);
av_set_pts_info
(
st
,
64
,
AV_RB32
(
buf
+
12
),
AV_RB32
(
buf
+
8
));
st
->
time_base
.
num
=
AV_RB32
(
buf
+
12
);
return
1
;
return
1
;
}
}
...
...
libavformat/oggparseflac.c
View file @
a351110e
...
@@ -65,8 +65,7 @@ flac_header (AVFormatContext * s, int idx)
...
@@ -65,8 +65,7 @@ flac_header (AVFormatContext * s, int idx)
memcpy
(
st
->
codec
->
extradata
,
streaminfo_start
,
FLAC_STREAMINFO_SIZE
);
memcpy
(
st
->
codec
->
extradata
,
streaminfo_start
,
FLAC_STREAMINFO_SIZE
);
st
->
codec
->
extradata_size
=
FLAC_STREAMINFO_SIZE
;
st
->
codec
->
extradata_size
=
FLAC_STREAMINFO_SIZE
;
st
->
time_base
.
num
=
1
;
av_set_pts_info
(
st
,
64
,
1
,
st
->
codec
->
sample_rate
);
st
->
time_base
.
den
=
st
->
codec
->
sample_rate
;
}
else
if
(
mdt
==
FLAC_METADATA_TYPE_VORBIS_COMMENT
)
{
}
else
if
(
mdt
==
FLAC_METADATA_TYPE_VORBIS_COMMENT
)
{
ff_vorbis_comment
(
s
,
&
st
->
metadata
,
os
->
buf
+
os
->
pstart
+
4
,
os
->
psize
-
4
);
ff_vorbis_comment
(
s
,
&
st
->
metadata
,
os
->
buf
+
os
->
pstart
+
4
,
os
->
psize
-
4
);
}
}
...
...
libavformat/oggparseogm.c
View file @
a351110e
...
@@ -83,14 +83,13 @@ ogm_header(AVFormatContext *s, int idx)
...
@@ -83,14 +83,13 @@ ogm_header(AVFormatContext *s, int idx)
st
->
codec
->
height
=
bytestream_get_le32
(
&
p
);
st
->
codec
->
height
=
bytestream_get_le32
(
&
p
);
st
->
codec
->
time_base
.
den
=
spu
*
10000000
;
st
->
codec
->
time_base
.
den
=
spu
*
10000000
;
st
->
codec
->
time_base
.
num
=
time_unit
;
st
->
codec
->
time_base
.
num
=
time_unit
;
st
->
time_base
=
st
->
codec
->
time_base
;
av_set_pts_info
(
st
,
64
,
st
->
codec
->
time_base
.
num
,
st
->
codec
->
time_base
.
den
)
;
}
else
{
}
else
{
st
->
codec
->
channels
=
bytestream_get_le16
(
&
p
);
st
->
codec
->
channels
=
bytestream_get_le16
(
&
p
);
p
+=
2
;
/* block_align */
p
+=
2
;
/* block_align */
st
->
codec
->
bit_rate
=
bytestream_get_le32
(
&
p
)
*
8
;
st
->
codec
->
bit_rate
=
bytestream_get_le32
(
&
p
)
*
8
;
st
->
codec
->
sample_rate
=
spu
*
10000000
/
time_unit
;
st
->
codec
->
sample_rate
=
spu
*
10000000
/
time_unit
;
st
->
time_base
.
num
=
1
;
av_set_pts_info
(
st
,
64
,
1
,
st
->
codec
->
sample_rate
);
st
->
time_base
.
den
=
st
->
codec
->
sample_rate
;
}
}
}
else
if
(
*
p
==
3
)
{
}
else
if
(
*
p
==
3
)
{
if
(
os
->
psize
>
8
)
if
(
os
->
psize
>
8
)
...
...
libavformat/oggparseskeleton.c
View file @
a351110e
...
@@ -60,8 +60,9 @@ static int skeleton_header(AVFormatContext *s, int idx)
...
@@ -60,8 +60,9 @@ static int skeleton_header(AVFormatContext *s, int idx)
start_den
=
AV_RL64
(
buf
+
20
);
start_den
=
AV_RL64
(
buf
+
20
);
if
(
start_den
)
{
if
(
start_den
)
{
av_reduce
(
&
start_time
,
&
st
->
time_base
.
den
,
start_num
,
start_den
,
INT_MAX
);
int64_t
base_den
;
st
->
time_base
.
num
=
1
;
av_reduce
(
&
start_time
,
&
base_den
,
start_num
,
start_den
,
INT_MAX
);
av_set_pts_info
(
st
,
64
,
1
,
base_den
);
os
->
lastpts
=
os
->
lastpts
=
st
->
start_time
=
start_time
;
st
->
start_time
=
start_time
;
}
}
...
...
libavformat/oggparsespeex.c
View file @
a351110e
...
@@ -72,8 +72,7 @@ static int speex_header(AVFormatContext *s, int idx) {
...
@@ -72,8 +72,7 @@ static int speex_header(AVFormatContext *s, int idx) {
+
FF_INPUT_BUFFER_PADDING_SIZE
);
+
FF_INPUT_BUFFER_PADDING_SIZE
);
memcpy
(
st
->
codec
->
extradata
,
p
,
st
->
codec
->
extradata_size
);
memcpy
(
st
->
codec
->
extradata
,
p
,
st
->
codec
->
extradata_size
);
st
->
time_base
.
num
=
1
;
av_set_pts_info
(
st
,
64
,
1
,
st
->
codec
->
sample_rate
);
st
->
time_base
.
den
=
st
->
codec
->
sample_rate
;
}
else
}
else
ff_vorbis_comment
(
s
,
&
st
->
metadata
,
p
,
os
->
psize
);
ff_vorbis_comment
(
s
,
&
st
->
metadata
,
p
,
os
->
psize
);
...
...
libavformat/oggparsetheora.c
View file @
a351110e
...
@@ -91,7 +91,7 @@ theora_header (AVFormatContext * s, int idx)
...
@@ -91,7 +91,7 @@ theora_header (AVFormatContext * s, int idx)
st
->
codec
->
time_base
.
num
=
1
;
st
->
codec
->
time_base
.
num
=
1
;
st
->
codec
->
time_base
.
den
=
25
;
st
->
codec
->
time_base
.
den
=
25
;
}
}
st
->
time_base
=
st
->
codec
->
time_base
;
av_set_pts_info
(
st
,
64
,
st
->
codec
->
time_base
.
num
,
st
->
codec
->
time_base
.
den
)
;
st
->
sample_aspect_ratio
.
num
=
get_bits_long
(
&
gb
,
24
);
st
->
sample_aspect_ratio
.
num
=
get_bits_long
(
&
gb
,
24
);
st
->
sample_aspect_ratio
.
den
=
get_bits_long
(
&
gb
,
24
);
st
->
sample_aspect_ratio
.
den
=
get_bits_long
(
&
gb
,
24
);
...
...
libavformat/oggparsevorbis.c
View file @
a351110e
...
@@ -252,8 +252,7 @@ vorbis_header (AVFormatContext * s, int idx)
...
@@ -252,8 +252,7 @@ vorbis_header (AVFormatContext * s, int idx)
if
(
srate
>
0
)
{
if
(
srate
>
0
)
{
st
->
codec
->
sample_rate
=
srate
;
st
->
codec
->
sample_rate
=
srate
;
st
->
time_base
.
num
=
1
;
av_set_pts_info
(
st
,
64
,
1
,
srate
);
st
->
time_base
.
den
=
srate
;
}
}
}
else
if
(
os
->
buf
[
os
->
pstart
]
==
3
)
{
}
else
if
(
os
->
buf
[
os
->
pstart
]
==
3
)
{
if
(
os
->
psize
>
8
&&
if
(
os
->
psize
>
8
&&
...
...
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