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
1ce50d32
Commit
1ce50d32
authored
Mar 28, 2008
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
indent
Originally committed as revision 12618 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
9bcc2883
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
43 deletions
+41
-43
avidec.c
libavformat/avidec.c
+41
-43
No files found.
libavformat/avidec.c
View file @
1ce50d32
...
...
@@ -777,41 +777,40 @@ resync:
//parse ##dc/##wb
if
(
n
<
s
->
nb_streams
){
AVStream
*
st
;
AVIStream
*
ast
;
st
=
s
->
streams
[
n
];
ast
=
st
->
priv_data
;
AVStream
*
st
;
AVIStream
*
ast
;
st
=
s
->
streams
[
n
];
ast
=
st
->
priv_data
;
if
(
s
->
nb_streams
>=
2
){
AVStream
*
st1
=
s
->
streams
[
1
];
AVIStream
*
ast1
=
st1
->
priv_data
;
//workaround for broken small-file-bug402.avi
if
(
d
[
2
]
==
'w'
&&
d
[
3
]
==
'b'
&&
n
==
0
&&
st
->
codec
->
codec_type
==
CODEC_TYPE_VIDEO
&&
st1
->
codec
->
codec_type
==
CODEC_TYPE_AUDIO
&&
ast
->
prefix
==
'd'
*
256
+
'c'
&&
(
d
[
2
]
*
256
+
d
[
3
]
==
ast1
->
prefix
||
!
ast1
->
prefix_count
)
){
n
=
1
;
st
=
st1
;
ast
=
ast1
;
av_log
(
s
,
AV_LOG_WARNING
,
"Invalid stream+prefix combination, assuming audio
\n
"
);
}
//workaround for broken small-file-bug402.avi
if
(
d
[
2
]
==
'w'
&&
d
[
3
]
==
'b'
&&
n
==
0
&&
st
->
codec
->
codec_type
==
CODEC_TYPE_VIDEO
&&
st1
->
codec
->
codec_type
==
CODEC_TYPE_AUDIO
&&
ast
->
prefix
==
'd'
*
256
+
'c'
&&
(
d
[
2
]
*
256
+
d
[
3
]
==
ast1
->
prefix
||
!
ast1
->
prefix_count
)
){
n
=
1
;
st
=
st1
;
ast
=
ast1
;
av_log
(
s
,
AV_LOG_WARNING
,
"Invalid stream+prefix combination, assuming audio
\n
"
);
}
}
if
(
(
st
->
discard
>=
AVDISCARD_DEFAULT
&&
size
==
0
)
/*|| (st->discard >= AVDISCARD_NONKEY && !(pkt->flags & PKT_FLAG_KEY))*/
//FIXME needs a little reordering
||
st
->
discard
>=
AVDISCARD_ALL
){
if
(
(
st
->
discard
>=
AVDISCARD_DEFAULT
&&
size
==
0
)
/*|| (st->discard >= AVDISCARD_NONKEY && !(pkt->flags & PKT_FLAG_KEY))*/
//FIXME needs a little reordering
||
st
->
discard
>=
AVDISCARD_ALL
){
if
(
ast
->
sample_size
)
ast
->
frame_offset
+=
pkt
->
size
;
else
ast
->
frame_offset
++
;
url_fskip
(
pb
,
size
);
goto
resync
;
}
}
if
(
d
[
2
]
==
'p'
&&
d
[
3
]
==
'c'
&&
size
<=
4
*
256
+
4
)
{
if
(
d
[
2
]
==
'p'
&&
d
[
3
]
==
'c'
&&
size
<=
4
*
256
+
4
)
{
int
k
=
get_byte
(
pb
);
int
last
=
(
k
+
get_byte
(
pb
)
-
1
)
&
0xFF
;
...
...
@@ -821,32 +820,31 @@ resync:
ast
->
pal
[
k
]
=
get_be32
(
pb
)
>>
8
;
// b + (g << 8) + (r << 16);
ast
->
has_pal
=
1
;
goto
resync
;
}
else
if
(
((
ast
->
prefix_count
<
5
||
sync
+
9
>
i
)
&&
d
[
2
]
<
128
&&
d
[
3
]
<
128
)
||
d
[
2
]
*
256
+
d
[
3
]
==
ast
->
prefix
/*||
(d[2] == 'd' && d[3] == 'c') ||
(d[2] == 'w' && d[3] == 'b')*/
)
{
}
else
if
(
((
ast
->
prefix_count
<
5
||
sync
+
9
>
i
)
&&
d
[
2
]
<
128
&&
d
[
3
]
<
128
)
||
d
[
2
]
*
256
+
d
[
3
]
==
ast
->
prefix
/*||
(d[2] == 'd' && d[3] == 'c') ||
(d[2] == 'w' && d[3] == 'b')*/
)
{
//av_log(NULL, AV_LOG_DEBUG, "OK\n");
if
(
d
[
2
]
*
256
+
d
[
3
]
==
ast
->
prefix
)
ast
->
prefix_count
++
;
else
{
ast
->
prefix
=
d
[
2
]
*
256
+
d
[
3
];
ast
->
prefix_count
=
0
;
}
if
(
d
[
2
]
*
256
+
d
[
3
]
==
ast
->
prefix
)
ast
->
prefix_count
++
;
else
{
ast
->
prefix
=
d
[
2
]
*
256
+
d
[
3
];
ast
->
prefix_count
=
0
;
}
avi
->
stream_index
=
n
;
ast
->
packet_size
=
size
+
8
;
ast
->
remaining
=
size
;
avi
->
stream_index
=
n
;
ast
->
packet_size
=
size
+
8
;
ast
->
remaining
=
size
;
{
uint64_t
pos
=
url_ftell
(
pb
)
-
8
;
if
(
!
st
->
index_entries
||
!
st
->
nb_index_entries
||
st
->
index_entries
[
st
->
nb_index_entries
-
1
].
pos
<
pos
){
av_add_index_entry
(
st
,
pos
,
ast
->
frame_offset
/
FFMAX
(
1
,
ast
->
sample_size
),
size
,
0
,
AVINDEX_KEYFRAME
);
{
uint64_t
pos
=
url_ftell
(
pb
)
-
8
;
if
(
!
st
->
index_entries
||
!
st
->
nb_index_entries
||
st
->
index_entries
[
st
->
nb_index_entries
-
1
].
pos
<
pos
){
av_add_index_entry
(
st
,
pos
,
ast
->
frame_offset
/
FFMAX
(
1
,
ast
->
sample_size
),
size
,
0
,
AVINDEX_KEYFRAME
);
}
}
goto
resync
;
}
goto
resync
;
}
}
}
...
...
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