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
5b977c1d
Commit
5b977c1d
authored
Jan 08, 2014
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mxf: Return meaningful errors
parent
f06f6daa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
mxfdec.c
libavformat/mxfdec.c
+12
-9
No files found.
libavformat/mxfdec.c
View file @
5b977c1d
...
@@ -2263,17 +2263,18 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
...
@@ -2263,17 +2263,18 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
{
{
KLVPacket
klv
;
KLVPacket
klv
;
MXFContext
*
mxf
=
s
->
priv_data
;
MXFContext
*
mxf
=
s
->
priv_data
;
int
ret
;
while
(
!
s
->
pb
->
eof_reached
)
{
while
(
!
s
->
pb
->
eof_reached
)
{
if
(
klv_read_packet
(
&
klv
,
s
->
pb
)
<
0
)
if
(
(
ret
=
klv_read_packet
(
&
klv
,
s
->
pb
)
)
<
0
)
return
-
1
;
return
ret
;
PRINT_KEY
(
s
,
"read packet"
,
klv
.
key
);
PRINT_KEY
(
s
,
"read packet"
,
klv
.
key
);
av_dlog
(
s
,
"size %"
PRIu64
" offset %#"
PRIx64
"
\n
"
,
klv
.
length
,
klv
.
offset
);
av_dlog
(
s
,
"size %"
PRIu64
" offset %#"
PRIx64
"
\n
"
,
klv
.
length
,
klv
.
offset
);
if
(
IS_KLV_KEY
(
klv
.
key
,
mxf_encrypted_triplet_key
))
{
if
(
IS_KLV_KEY
(
klv
.
key
,
mxf_encrypted_triplet_key
))
{
int
res
=
mxf_decrypt_triplet
(
s
,
pkt
,
&
klv
);
ret
=
mxf_decrypt_triplet
(
s
,
pkt
,
&
klv
);
if
(
re
s
<
0
)
{
if
(
re
t
<
0
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"invalid encoded triplet
\n
"
);
av_log
(
s
,
AV_LOG_ERROR
,
"invalid encoded triplet
\n
"
);
return
-
1
;
return
ret
;
}
}
return
0
;
return
0
;
}
}
...
@@ -2313,12 +2314,14 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
...
@@ -2313,12 +2314,14 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
/* check for 8 channels AES3 element */
/* check for 8 channels AES3 element */
if
(
klv
.
key
[
12
]
==
0x06
&&
klv
.
key
[
13
]
==
0x01
&&
klv
.
key
[
14
]
==
0x10
)
{
if
(
klv
.
key
[
12
]
==
0x06
&&
klv
.
key
[
13
]
==
0x01
&&
klv
.
key
[
14
]
==
0x10
)
{
if
(
mxf_get_d10_aes3_packet
(
s
->
pb
,
s
->
streams
[
index
],
pkt
,
klv
.
length
)
<
0
)
{
ret
=
mxf_get_d10_aes3_packet
(
s
->
pb
,
s
->
streams
[
index
],
pkt
,
klv
.
length
);
if
(
ret
<
0
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"error reading D-10 aes3 frame
\n
"
);
av_log
(
s
,
AV_LOG_ERROR
,
"error reading D-10 aes3 frame
\n
"
);
return
-
1
;
return
ret
;
}
}
}
else
{
}
else
{
int
ret
=
av_get_packet
(
s
->
pb
,
pkt
,
klv
.
length
);
ret
=
av_get_packet
(
s
->
pb
,
pkt
,
klv
.
length
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
ret
;
return
ret
;
}
}
...
@@ -2343,7 +2346,7 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
...
@@ -2343,7 +2346,7 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
pkt
->
pts
=
mxf
->
current_edit_unit
;
pkt
->
pts
=
mxf
->
current_edit_unit
;
}
}
}
else
if
(
codec
->
codec_type
==
AVMEDIA_TYPE_AUDIO
)
{
}
else
if
(
codec
->
codec_type
==
AVMEDIA_TYPE_AUDIO
)
{
int
ret
=
mxf_set_audio_pts
(
mxf
,
codec
,
pkt
);
ret
=
mxf_set_audio_pts
(
mxf
,
codec
,
pkt
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
ret
;
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