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
1d128e58
Commit
1d128e58
authored
12 years ago
by
Reimar Döffinger
Browse files
Options
Downloads
Patches
Plain Diff
nutdec: replace assert with av_assert0.
Signed-off-by:
Reimar Döffinger
<
Reimar.Doeffinger@gmx.de
>
parent
73edb58c
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
+9
-11
9 additions, 11 deletions
libavformat/nutdec.c
with
9 additions
and
11 deletions
libavformat/nutdec.c
+
9
−
11
View file @
1d128e58
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
*/
*/
#include
"libavutil/avstring.h"
#include
"libavutil/avstring.h"
#include
"libavutil/avassert.h"
#include
"libavutil/bswap.h"
#include
"libavutil/bswap.h"
#include
"libavutil/dict.h"
#include
"libavutil/dict.h"
#include
"libavutil/mathematics.h"
#include
"libavutil/mathematics.h"
...
@@ -28,9 +29,6 @@
...
@@ -28,9 +29,6 @@
#include
"avio_internal.h"
#include
"avio_internal.h"
#include
"nut.h"
#include
"nut.h"
#undef NDEBUG
#include
<assert.h>
#define NUT_MAX_STREAMS 256
/* arbitrary sanity check value */
#define NUT_MAX_STREAMS 256
/* arbitrary sanity check value */
static
int
get_str
(
AVIOContext
*
bc
,
char
*
string
,
unsigned
int
maxlen
)
static
int
get_str
(
AVIOContext
*
bc
,
char
*
string
,
unsigned
int
maxlen
)
...
@@ -298,7 +296,7 @@ static int decode_main_header(NUTContext *nut)
...
@@ -298,7 +296,7 @@ static int decode_main_header(NUTContext *nut)
nut
->
frame_code
[
i
].
header_idx
=
tmp_head_idx
;
nut
->
frame_code
[
i
].
header_idx
=
tmp_head_idx
;
}
}
}
}
assert
(
nut
->
frame_code
[
'N'
].
flags
==
FLAG_INVALID
);
av_
assert
0
(
nut
->
frame_code
[
'N'
].
flags
==
FLAG_INVALID
);
if
(
end
>
avio_tell
(
bc
)
+
4
)
{
if
(
end
>
avio_tell
(
bc
)
+
4
)
{
int
rem
=
1024
;
int
rem
=
1024
;
...
@@ -318,7 +316,7 @@ static int decode_main_header(NUTContext *nut)
...
@@ -318,7 +316,7 @@ static int decode_main_header(NUTContext *nut)
avio_read
(
bc
,
hdr
,
nut
->
header_len
[
i
]);
avio_read
(
bc
,
hdr
,
nut
->
header_len
[
i
]);
nut
->
header
[
i
]
=
hdr
;
nut
->
header
[
i
]
=
hdr
;
}
}
assert
(
nut
->
header_len
[
0
]
==
0
);
av_
assert
0
(
nut
->
header_len
[
0
]
==
0
);
}
}
if
(
skip_reserved
(
bc
,
end
)
||
ffio_get_checksum
(
bc
))
{
if
(
skip_reserved
(
bc
,
end
)
||
ffio_get_checksum
(
bc
))
{
...
@@ -617,7 +615,7 @@ static int find_and_decode_index(NUTContext *nut)
...
@@ -617,7 +615,7 @@ static int find_and_decode_index(NUTContext *nut)
av_log
(
s
,
AV_LOG_ERROR
,
"keyframe before first syncpoint in index
\n
"
);
av_log
(
s
,
AV_LOG_ERROR
,
"keyframe before first syncpoint in index
\n
"
);
goto
fail
;
goto
fail
;
}
}
assert
(
n
<=
syncpoint_count
+
1
);
av_
assert
0
(
n
<=
syncpoint_count
+
1
);
for
(;
j
<
n
&&
j
<
syncpoint_count
;
j
++
)
{
for
(;
j
<
n
&&
j
<
syncpoint_count
;
j
++
)
{
if
(
has_keyframe
[
j
])
{
if
(
has_keyframe
[
j
])
{
uint64_t
B
,
A
=
ffio_read_varlen
(
bc
);
uint64_t
B
,
A
=
ffio_read_varlen
(
bc
);
...
@@ -704,7 +702,7 @@ static int nut_read_header(AVFormatContext *s)
...
@@ -704,7 +702,7 @@ static int nut_read_header(AVFormatContext *s)
find_and_decode_index
(
nut
);
find_and_decode_index
(
nut
);
avio_seek
(
bc
,
orig_pos
,
SEEK_SET
);
avio_seek
(
bc
,
orig_pos
,
SEEK_SET
);
}
}
assert
(
nut
->
next_startcode
==
SYNCPOINT_STARTCODE
);
av_
assert
0
(
nut
->
next_startcode
==
SYNCPOINT_STARTCODE
);
ff_metadata_conv_ctx
(
s
,
NULL
,
ff_nut_metadata_conv
);
ff_metadata_conv_ctx
(
s
,
NULL
,
ff_nut_metadata_conv
);
...
@@ -897,13 +895,13 @@ static int64_t nut_read_timestamp(AVFormatContext *s, int stream_index,
...
@@ -897,13 +895,13 @@ static int64_t nut_read_timestamp(AVFormatContext *s, int stream_index,
do
{
do
{
pos
=
find_startcode
(
bc
,
SYNCPOINT_STARTCODE
,
pos
)
+
1
;
pos
=
find_startcode
(
bc
,
SYNCPOINT_STARTCODE
,
pos
)
+
1
;
if
(
pos
<
1
)
{
if
(
pos
<
1
)
{
assert
(
nut
->
next_startcode
==
0
);
av_
assert
0
(
nut
->
next_startcode
==
0
);
av_log
(
s
,
AV_LOG_ERROR
,
"read_timestamp failed.
\n
"
);
av_log
(
s
,
AV_LOG_ERROR
,
"read_timestamp failed.
\n
"
);
return
AV_NOPTS_VALUE
;
return
AV_NOPTS_VALUE
;
}
}
}
while
(
decode_syncpoint
(
nut
,
&
pts
,
&
back_ptr
)
<
0
);
}
while
(
decode_syncpoint
(
nut
,
&
pts
,
&
back_ptr
)
<
0
);
*
pos_arg
=
pos
-
1
;
*
pos_arg
=
pos
-
1
;
assert
(
nut
->
last_syncpoint_pos
==
*
pos_arg
);
av_
assert
0
(
nut
->
last_syncpoint_pos
==
*
pos_arg
);
av_log
(
s
,
AV_LOG_DEBUG
,
"return %"
PRId64
" %"
PRId64
"
\n
"
,
pts
,
back_ptr
);
av_log
(
s
,
AV_LOG_DEBUG
,
"return %"
PRId64
" %"
PRId64
"
\n
"
,
pts
,
back_ptr
);
if
(
stream_index
==
-
1
)
if
(
stream_index
==
-
1
)
...
@@ -911,7 +909,7 @@ static int64_t nut_read_timestamp(AVFormatContext *s, int stream_index,
...
@@ -911,7 +909,7 @@ static int64_t nut_read_timestamp(AVFormatContext *s, int stream_index,
else
if
(
stream_index
==
-
2
)
else
if
(
stream_index
==
-
2
)
return
back_ptr
;
return
back_ptr
;
assert
(
0
);
av_
assert
0
(
0
);
}
}
static
int
read_seek
(
AVFormatContext
*
s
,
int
stream_index
,
static
int
read_seek
(
AVFormatContext
*
s
,
int
stream_index
,
...
@@ -960,7 +958,7 @@ static int read_seek(AVFormatContext *s, int stream_index,
...
@@ -960,7 +958,7 @@ static int read_seek(AVFormatContext *s, int stream_index,
sp
=
av_tree_find
(
nut
->
syncpoints
,
&
dummy
,
(
void
*
)
ff_nut_sp_pos_cmp
,
sp
=
av_tree_find
(
nut
->
syncpoints
,
&
dummy
,
(
void
*
)
ff_nut_sp_pos_cmp
,
NULL
);
NULL
);
assert
(
sp
);
av_
assert
0
(
sp
);
pos2
=
sp
->
back_ptr
-
15
;
pos2
=
sp
->
back_ptr
-
15
;
}
}
av_log
(
NULL
,
AV_LOG_DEBUG
,
"SEEKTO: %"
PRId64
"
\n
"
,
pos2
);
av_log
(
NULL
,
AV_LOG_DEBUG
,
"SEEKTO: %"
PRId64
"
\n
"
,
pos2
);
...
...
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