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
20121213
Commit
20121213
authored
Feb 14, 2007
by
Baptiste Coudurier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix dts adjusting
Originally committed as revision 7982 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
41536a60
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
gxfenc.c
libavformat/gxfenc.c
+8
-9
No files found.
libavformat/gxfenc.c
View file @
20121213
...
...
@@ -572,6 +572,8 @@ static int gxf_write_umf_packet(ByteIOContext *pb, GXFContext *ctx)
return
updatePacketSize
(
pb
,
pos
);
}
#define GXF_NODELAY -5000
static
int
gxf_write_header
(
AVFormatContext
*
s
)
{
ByteIOContext
*
pb
=
&
s
->
pb
;
...
...
@@ -623,7 +625,8 @@ static int gxf_write_header(AVFormatContext *s)
gxf
->
flags
|=
0x00000040
;
}
gxf
->
sample_rate
=
sc
->
sample_rate
;
av_set_pts_info
(
st
,
64
,
1
,
sc
->
sample_rate
);
av_set_pts_info
(
st
,
64
,
1
,
st
->
codec
->
time_base
.
den
);
sc
->
dts_delay
=
GXF_NODELAY
;
if
(
gxf_find_lines_index
(
sc
)
<
0
)
sc
->
lines_index
=
-
1
;
sc
->
sample_size
=
st
->
codec
->
bit_rate
;
...
...
@@ -707,7 +710,7 @@ static int gxf_parse_mpeg_frame(GXFStreamContext *sc, const uint8_t *buf, int si
static
int
gxf_write_media_preamble
(
ByteIOContext
*
pb
,
GXFContext
*
ctx
,
AVPacket
*
pkt
,
int
size
)
{
GXFStreamContext
*
sc
=
&
ctx
->
streams
[
pkt
->
stream_index
];
int64_t
dts
=
av_rescale
(
pkt
->
dts
,
ctx
->
sample_rate
,
sc
->
sample_rate
);
int64_t
dts
=
av_rescale
(
pkt
->
dts
,
ctx
->
sample_rate
,
sc
->
codec
->
time_base
.
den
);
put_byte
(
pb
,
sc
->
media_type
);
put_byte
(
pb
,
sc
->
index
);
...
...
@@ -799,13 +802,9 @@ static int gxf_interleave_packet(AVFormatContext *s, AVPacket *out, AVPacket *pk
break
;
/* add pkt right now into list */
}
}
}
else
if
(
pkt
)
{
/* adjust dts if negative */
if
(
pkt
->
dts
<
0
&&
!
sc
->
dts_delay
)
{
/* XXX: rescale if codec time base is different from stream time base */
sc
->
dts_delay
=
av_rescale_q
(
pkt
->
dts
,
st
->
codec
->
time_base
,
st
->
time_base
);
pkt
->
dts
=
sc
->
dts_delay
;
/* set to 0 */
}
}
else
if
(
pkt
&&
pkt
->
stream_index
==
i
)
{
if
(
sc
->
dts_delay
==
GXF_NODELAY
)
/* adjust dts if needed */
sc
->
dts_delay
=
pkt
->
dts
;
pkt
->
dts
-=
sc
->
dts_delay
;
}
}
...
...
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