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
6a287fd7
Commit
6a287fd7
authored
Nov 28, 2006
by
Baptiste Coudurier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
readjust dts if negative
Originally committed as revision 7179 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
7504e4fa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
gxfenc.c
libavformat/gxfenc.c
+12
-2
libav.regression.ref
tests/libav.regression.ref
+2
-2
No files found.
libavformat/gxfenc.c
View file @
6a287fd7
...
...
@@ -45,6 +45,7 @@ typedef struct GXFStreamContext {
int
b_per_gop
;
int
first_gop_closed
;
int64_t
current_dts
;
int
dts_delay
;
}
GXFStreamContext
;
typedef
struct
GXFContext
{
...
...
@@ -785,8 +786,9 @@ static int gxf_interleave_packet(AVFormatContext *s, AVPacket *out, AVPacket *pk
int
i
;
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
{
if
(
s
->
streams
[
i
]
->
codec
->
codec_type
==
CODEC_TYPE_AUDIO
)
{
GXFStreamContext
*
sc
=
&
gxf
->
streams
[
i
];
AVStream
*
st
=
s
->
streams
[
i
];
GXFStreamContext
*
sc
=
&
gxf
->
streams
[
i
];
if
(
st
->
codec
->
codec_type
==
CODEC_TYPE_AUDIO
)
{
if
(
pkt
&&
pkt
->
stream_index
==
i
)
{
av_fifo_write
(
&
sc
->
audio_buffer
,
pkt
->
data
,
pkt
->
size
);
pkt
=
NULL
;
...
...
@@ -797,6 +799,14 @@ 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 */
}
pkt
->
dts
-=
sc
->
dts_delay
;
}
}
return
av_interleave_packet_per_dts
(
s
,
out
,
pkt
,
flush
);
...
...
tests/libav.regression.ref
View file @
6a287fd7
...
...
@@ -28,9 +28,9 @@ bac6c5f50f3ca5db6e2ef6eaccf1d4f1 *./data/b-libav.asf
26c41db318d9aacfd6b9e734c0ea4d94 *./data/b-libav.dv
3600000 ./data/b-libav.dv
./data/b-libav.dv CRC=0xa6b8b635
304ee17506e4526ba04285f6cd14630f
*./data/b-libav.gxf
ff65eeeb156c8b42ad9fdb7c8dbdb6b7
*./data/b-libav.gxf
816068 ./data/b-libav.gxf
./data/b-libav.gxf CRC=0xb
2d6
44fa
./data/b-libav.gxf CRC=0xb
190
44fa
9a9da315747599f7718cc9a9a09c21ff *./data/b-libav.pbm
317075 ./data/b-libav.pbm
./data/b-libav.pbm CRC=0xb92906cb
...
...
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