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
f900f35a
Commit
f900f35a
authored
Jul 31, 2013
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flvdec: Eliminate completely silly goto
parent
e4529df9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
11 deletions
+7
-11
flvdec.c
libavformat/flvdec.c
+7
-11
No files found.
libavformat/flvdec.c
View file @
f900f35a
...
...
@@ -636,35 +636,32 @@ static void clear_index_entries(AVFormatContext *s, int64_t pos)
static
int
flv_data_packet
(
AVFormatContext
*
s
,
AVPacket
*
pkt
,
int64_t
dts
,
int64_t
next
)
{
int
ret
=
AVERROR_INVALIDDATA
,
i
;
AVIOContext
*
pb
=
s
->
pb
;
AVStream
*
st
=
NULL
;
AMFDataType
type
;
char
buf
[
20
];
int
length
;
int
ret
,
i
,
length
;
type
=
avio_r8
(
pb
);
if
(
type
==
AMF_DATA_TYPE_MIXEDARRAY
)
avio_seek
(
pb
,
4
,
SEEK_CUR
);
else
if
(
type
!=
AMF_DATA_TYPE_OBJECT
)
goto
out
;
return
AVERROR_INVALIDDATA
;
amf_get_string
(
pb
,
buf
,
sizeof
(
buf
));
if
(
strcmp
(
buf
,
"type"
)
||
avio_r8
(
pb
)
!=
AMF_DATA_TYPE_STRING
)
goto
out
;
return
AVERROR_INVALIDDATA
;
amf_get_string
(
pb
,
buf
,
sizeof
(
buf
));
// FIXME parse it as codec_id
amf_get_string
(
pb
,
buf
,
sizeof
(
buf
));
if
(
strcmp
(
buf
,
"text"
)
||
avio_r8
(
pb
)
!=
AMF_DATA_TYPE_STRING
)
goto
out
;
return
AVERROR_INVALIDDATA
;
length
=
avio_rb16
(
pb
);
ret
=
av_get_packet
(
s
->
pb
,
pkt
,
length
);
if
(
ret
<
0
)
{
ret
=
AVERROR
(
EIO
);
goto
out
;
}
if
(
ret
<
0
)
return
AVERROR
(
EIO
);
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
{
st
=
s
->
streams
[
i
];
...
...
@@ -675,7 +672,7 @@ static int flv_data_packet(AVFormatContext *s, AVPacket *pkt,
if
(
i
==
s
->
nb_streams
)
{
st
=
create_stream
(
s
,
AVMEDIA_TYPE_DATA
);
if
(
!
st
)
goto
out
;
return
AVERROR_INVALIDDATA
;
st
->
codec
->
codec_id
=
AV_CODEC_ID_TEXT
;
}
...
...
@@ -688,7 +685,6 @@ static int flv_data_packet(AVFormatContext *s, AVPacket *pkt,
avio_seek
(
s
->
pb
,
next
+
4
,
SEEK_SET
);
out:
return
ret
;
}
...
...
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