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
caf5fb95
Commit
caf5fb95
authored
Apr 26, 2005
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix nonsens timestamp calculation
Originally committed as revision 4165 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
8cf71ead
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
12 deletions
+5
-12
4xm.c
libavformat/4xm.c
+5
-12
No files found.
libavformat/4xm.c
View file @
caf5fb95
...
...
@@ -72,7 +72,6 @@ typedef struct FourxmDemuxContext {
int64_t
audio_pts
;
int64_t
video_pts
;
int
video_pts_inc
;
float
fps
;
}
FourxmDemuxContext
;
...
...
@@ -149,7 +148,6 @@ static int fourxm_read_header(AVFormatContext *s,
if
(
fourcc_tag
==
std__TAG
)
{
fourxm
->
fps
=
get_le_float
(
&
header
[
i
+
12
]);
fourxm
->
video_pts_inc
=
(
int
)(
90000
.
0
/
fourxm
->
fps
);
}
else
if
(
fourcc_tag
==
vtrk_TAG
)
{
/* check that there is enough data */
if
(
size
!=
vtrk_SIZE
)
{
...
...
@@ -164,7 +162,7 @@ static int fourxm_read_header(AVFormatContext *s,
st
=
av_new_stream
(
s
,
0
);
if
(
!
st
)
return
AVERROR_NOMEM
;
av_set_pts_info
(
st
,
33
,
1
,
90000
);
av_set_pts_info
(
st
,
60
,
1
,
fourxm
->
fps
);
fourxm
->
video_stream_index
=
st
->
index
;
...
...
@@ -205,8 +203,7 @@ static int fourxm_read_header(AVFormatContext *s,
if
(
!
st
)
return
AVERROR_NOMEM
;
/* set the pts reference (1 pts = 1/90000) */
av_set_pts_info
(
st
,
33
,
1
,
90000
);
av_set_pts_info
(
st
,
60
,
1
,
fourxm
->
tracks
[
current_track
].
sample_rate
);
fourxm
->
tracks
[
current_track
].
stream_index
=
st
->
index
;
...
...
@@ -235,7 +232,7 @@ static int fourxm_read_header(AVFormatContext *s,
return
AVERROR_INVALIDDATA
;
/* initialize context members */
fourxm
->
video_pts
=
-
fourxm
->
video_pts_inc
;
/* first frame will push to 0 */
fourxm
->
video_pts
=
-
1
;
/* first frame will push to 0 */
fourxm
->
audio_pts
=
0
;
return
0
;
...
...
@@ -252,7 +249,6 @@ static int fourxm_read_packet(AVFormatContext *s,
int
track_number
;
int
packet_read
=
0
;
unsigned
char
header
[
8
];
int64_t
pts_inc
;
int
audio_frame_count
;
while
(
!
packet_read
)
{
...
...
@@ -267,7 +263,7 @@ static int fourxm_read_packet(AVFormatContext *s,
case
LIST_TAG
:
/* this is a good time to bump the video pts */
fourxm
->
video_pts
+
=
fourxm
->
video_pts_inc
;
fourxm
->
video_pts
+
+
;
/* skip the LIST-* tag and move on to the next fourcc */
get_le32
(
pb
);
...
...
@@ -322,10 +318,7 @@ static int fourxm_read_packet(AVFormatContext *s,
else
audio_frame_count
/=
(
fourxm
->
tracks
[
fourxm
->
selected_track
].
bits
/
8
);
pts_inc
=
audio_frame_count
;
pts_inc
*=
90000
;
pts_inc
/=
fourxm
->
tracks
[
fourxm
->
selected_track
].
sample_rate
;
fourxm
->
audio_pts
+=
pts_inc
;
fourxm
->
audio_pts
+=
audio_frame_count
;
}
else
{
url_fseek
(
pb
,
size
,
SEEK_CUR
);
...
...
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