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
1d128e58
Commit
1d128e58
authored
Apr 28, 2012
by
Reimar Döffinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nutdec: replace assert with av_assert0.
Signed-off-by:
Reimar Döffinger
<
Reimar.Doeffinger@gmx.de
>
parent
73edb58c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
nutdec.c
libavformat/nutdec.c
+9
-11
No files found.
libavformat/nutdec.c
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
;
}
}
}
}
a
ssert
(
nut
->
frame_code
[
'N'
].
flags
==
FLAG_INVALID
);
a
v_assert0
(
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
;
}
}
a
ssert
(
nut
->
header_len
[
0
]
==
0
);
a
v_assert0
(
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
;
}
}
a
ssert
(
n
<=
syncpoint_count
+
1
);
a
v_assert0
(
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
);
}
}
a
ssert
(
nut
->
next_startcode
==
SYNCPOINT_STARTCODE
);
a
v_assert0
(
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
)
{
a
ssert
(
nut
->
next_startcode
==
0
);
a
v_assert0
(
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
;
a
ssert
(
nut
->
last_syncpoint_pos
==
*
pos_arg
);
a
v_assert0
(
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
;
a
ssert
(
0
);
a
v_assert0
(
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
);
a
ssert
(
sp
);
a
v_assert0
(
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
);
...
...
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