Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
e3c2d831
Commit
e3c2d831
authored
Jul 11, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avidec: switch to av_assert
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
74f3c53b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
avidec.c
libavformat/avidec.c
+8
-10
No files found.
libavformat/avidec.c
View file @
e3c2d831
...
@@ -25,15 +25,13 @@
...
@@ -25,15 +25,13 @@
#include "libavutil/opt.h"
#include "libavutil/opt.h"
#include "libavutil/dict.h"
#include "libavutil/dict.h"
#include "libavutil/avstring.h"
#include "libavutil/avstring.h"
#include "libavutil/avassert.h"
#include "avformat.h"
#include "avformat.h"
#include "internal.h"
#include "internal.h"
#include "avi.h"
#include "avi.h"
#include "dv.h"
#include "dv.h"
#include "riff.h"
#include "riff.h"
#undef NDEBUG
#include <assert.h>
typedef
struct
AVIStream
{
typedef
struct
AVIStream
{
int64_t
frame_offset
;
/* current frame (video) or byte (audio) counter
int64_t
frame_offset
;
/* current frame (video) or byte (audio) counter
(used to compute the pts) */
(used to compute the pts) */
...
@@ -513,7 +511,7 @@ static int avi_read_header(AVFormatContext *s)
...
@@ -513,7 +511,7 @@ static int avi_read_header(AVFormatContext *s)
break
;
break
;
}
}
a
ssert
(
stream_index
<
s
->
nb_streams
);
a
v_assert0
(
stream_index
<
s
->
nb_streams
);
st
->
codec
->
stream_codec_tag
=
handler
;
st
->
codec
->
stream_codec_tag
=
handler
;
avio_rl32
(
pb
);
/* flags */
avio_rl32
(
pb
);
/* flags */
...
@@ -1103,7 +1101,7 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt)
...
@@ -1103,7 +1101,7 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt)
return
AVERROR_EOF
;
return
AVERROR_EOF
;
// av_log(s, AV_LOG_DEBUG, "pos=%"PRId64"\n", pos);
// av_log(s, AV_LOG_DEBUG, "pos=%"PRId64"\n", pos);
a
ssert
(
best_ast
->
remaining
<=
best_ast
->
packet_size
);
a
v_assert0
(
best_ast
->
remaining
<=
best_ast
->
packet_size
);
avi
->
stream_index
=
best_stream_index
;
avi
->
stream_index
=
best_stream_index
;
if
(
!
best_ast
->
remaining
)
if
(
!
best_ast
->
remaining
)
...
@@ -1176,7 +1174,7 @@ resync:
...
@@ -1176,7 +1174,7 @@ resync:
if
(
st
->
codec
->
codec_type
==
AVMEDIA_TYPE_VIDEO
)
{
if
(
st
->
codec
->
codec_type
==
AVMEDIA_TYPE_VIDEO
)
{
AVIndexEntry
*
e
;
AVIndexEntry
*
e
;
int
index
;
int
index
;
a
ssert
(
st
->
index_entries
);
a
v_assert0
(
st
->
index_entries
);
index
=
av_index_search_timestamp
(
st
,
ast
->
frame_offset
,
0
);
index
=
av_index_search_timestamp
(
st
,
ast
->
frame_offset
,
0
);
e
=
&
st
->
index_entries
[
index
];
e
=
&
st
->
index_entries
[
index
];
...
@@ -1425,7 +1423,7 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
...
@@ -1425,7 +1423,7 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
avi_load_index
(
s
);
avi_load_index
(
s
);
avi
->
index_loaded
|=
1
;
avi
->
index_loaded
|=
1
;
}
}
a
ssert
(
stream_index
>=
0
);
a
v_assert0
(
stream_index
>=
0
);
st
=
s
->
streams
[
stream_index
];
st
=
s
->
streams
[
stream_index
];
ast
=
st
->
priv_data
;
ast
=
st
->
priv_data
;
...
@@ -1449,7 +1447,7 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
...
@@ -1449,7 +1447,7 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
/* One and only one real stream for DV in AVI, and it has video */
/* One and only one real stream for DV in AVI, and it has video */
/* offsets. Calling with other stream indexes should have failed */
/* offsets. Calling with other stream indexes should have failed */
/* the av_index_search_timestamp call above. */
/* the av_index_search_timestamp call above. */
a
ssert
(
stream_index
==
0
);
a
v_assert0
(
stream_index
==
0
);
if
(
avio_seek
(
s
->
pb
,
pos
,
SEEK_SET
)
<
0
)
if
(
avio_seek
(
s
->
pb
,
pos
,
SEEK_SET
)
<
0
)
return
-
1
;
return
-
1
;
...
@@ -1478,8 +1476,8 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
...
@@ -1478,8 +1476,8 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
if
(
st2
->
nb_index_entries
<=
0
)
if
(
st2
->
nb_index_entries
<=
0
)
continue
;
continue
;
// a
ssert
(st2->codec->block_align);
// a
v_assert1
(st2->codec->block_align);
a
ssert
((
int64_t
)
st2
->
time_base
.
num
*
ast2
->
rate
==
(
int64_t
)
st2
->
time_base
.
den
*
ast2
->
scale
);
a
v_assert0
((
int64_t
)
st2
->
time_base
.
num
*
ast2
->
rate
==
(
int64_t
)
st2
->
time_base
.
den
*
ast2
->
scale
);
index
=
av_index_search_timestamp
(
index
=
av_index_search_timestamp
(
st2
,
st2
,
av_rescale_q
(
timestamp
,
st
->
time_base
,
st2
->
time_base
)
*
FFMAX
(
ast2
->
sample_size
,
1
),
av_rescale_q
(
timestamp
,
st
->
time_base
,
st2
->
time_base
)
*
FFMAX
(
ast2
->
sample_size
,
1
),
...
...
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