Commit 1d128e58 authored by Reimar Döffinger's avatar Reimar Döffinger

nutdec: replace assert with av_assert0.

Signed-off-by: 's avatarReimar Döffinger <Reimar.Doeffinger@gmx.de>
parent 73edb58c
...@@ -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_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;
} }
assert(nut->header_len[0] == 0); av_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;
} }
assert(n <= syncpoint_count + 1); av_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);
} }
assert(nut->next_startcode == SYNCPOINT_STARTCODE); av_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) {
assert(nut->next_startcode == 0); av_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;
assert(nut->last_syncpoint_pos == *pos_arg); av_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;
assert(0); av_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);
assert(sp); av_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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment