Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
06599638
Commit
06599638
authored
18 years ago
by
Michael Niedermayer
Browse files
Options
Downloads
Patches
Plain Diff
check max_pts_distance
Originally committed as revision 7100 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
0a3b575b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavformat/nutdec.c
+13
-11
13 additions, 11 deletions
libavformat/nutdec.c
with
13 additions
and
11 deletions
libavformat/nutdec.c
+
13
−
11
View file @
06599638
...
...
@@ -637,7 +637,7 @@ static int nut_read_header(AVFormatContext *s, AVFormatParameters *ap)
return
0
;
}
static
int
decode_frame_header
(
NUTContext
*
nut
,
int
*
flags_ret
,
int64_t
*
pts
,
int
*
stream_id
,
int
frame_code
){
static
int
decode_frame_header
(
NUTContext
*
nut
,
int64_t
*
pts
,
int
*
stream_id
,
int
frame_code
){
AVFormatContext
*
s
=
nut
->
avf
;
ByteIOContext
*
bc
=
&
s
->
pb
;
StreamContext
*
stc
;
...
...
@@ -682,14 +682,13 @@ static int decode_frame_header(NUTContext *nut, int *flags_ret, int64_t *pts, in
get_v
(
bc
);
if
(
flags
&
FLAG_CHECKSUM
){
get_be32
(
bc
);
//FIXME check this
}
else
if
(
size
>
2
*
nut
->
max_distance
){
}
else
if
(
size
>
2
*
nut
->
max_distance
||
FFABS
(
stc
->
last_pts
-
*
pts
)
>
stc
->
max_pts_distance
){
av_log
(
s
,
AV_LOG_ERROR
,
"frame size > 2max_distance and no checksum
\n
"
);
return
-
1
;
}
*
flags_ret
=
flags
;
stc
->
last_pts
=
*
pts
;
stc
->
last_
key_frame
=
flags
&
FLAG_KEY
;
//FIXME change to last
flags
stc
->
last_
flags
=
flags
;
return
size
;
}
...
...
@@ -697,29 +696,32 @@ static int decode_frame_header(NUTContext *nut, int *flags_ret, int64_t *pts, in
static
int
decode_frame
(
NUTContext
*
nut
,
AVPacket
*
pkt
,
int
frame_code
){
AVFormatContext
*
s
=
nut
->
avf
;
ByteIOContext
*
bc
=
&
s
->
pb
;
int
size
,
stream_id
,
flags
,
discard
;
int
size
,
stream_id
,
discard
;
int64_t
pts
,
last_IP_pts
;
StreamContext
*
stc
;
size
=
decode_frame_header
(
nut
,
&
flags
,
&
pts
,
&
stream_id
,
frame_code
);
size
=
decode_frame_header
(
nut
,
&
pts
,
&
stream_id
,
frame_code
);
if
(
size
<
0
)
return
-
1
;
if
(
flags
&
FLAG_KEY
)
nut
->
stream
[
stream_id
].
skip_until_key_frame
=
0
;
stc
=
&
nut
->
stream
[
stream_id
];
if
(
stc
->
last_flags
&
FLAG_KEY
)
stc
->
skip_until_key_frame
=
0
;
discard
=
s
->
streams
[
stream_id
]
->
discard
;
last_IP_pts
=
s
->
streams
[
stream_id
]
->
last_IP_pts
;
if
(
(
discard
>=
AVDISCARD_NONKEY
&&
!
(
flags
&
FLAG_KEY
))
if
(
(
discard
>=
AVDISCARD_NONKEY
&&
!
(
stc
->
last_
flags
&
FLAG_KEY
))
||
(
discard
>=
AVDISCARD_BIDIR
&&
last_IP_pts
!=
AV_NOPTS_VALUE
&&
last_IP_pts
>
pts
)
||
discard
>=
AVDISCARD_ALL
||
nut
->
stream
[
stream_id
].
skip_until_key_frame
){
||
stc
->
skip_until_key_frame
){
url_fskip
(
bc
,
size
);
return
1
;
}
av_get_packet
(
bc
,
pkt
,
size
);
pkt
->
stream_index
=
stream_id
;
if
(
flags
&
FLAG_KEY
)
if
(
stc
->
last_
flags
&
FLAG_KEY
)
pkt
->
flags
|=
PKT_FLAG_KEY
;
pkt
->
pts
=
pts
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment