Commit 3967f680 authored by Joseph Artsimovich's avatar Joseph Artsimovich Committed by Michael Niedermayer

Better handling for MXF essence reading reaching EOF.

If no metadata follows MXF essence, that is essence ends with EOF,
"Operation not permitted" error was produced and a non-zero code
was returned from ffmpeg executable.
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 1e00bbb1
......@@ -2210,10 +2210,8 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
KLVPacket klv;
MXFContext *mxf = s->priv_data;
while (!url_feof(s->pb)) {
while (klv_read_packet(&klv, s->pb) == 0) {
int ret;
if (klv_read_packet(&klv, s->pb) < 0)
return -1;
PRINT_KEY(s, "read packet", klv.key);
av_dlog(s, "size %"PRIu64" offset %#"PRIx64"\n", klv.length, klv.offset);
if (IS_KLV_KEY(klv.key, mxf_encrypted_triplet_key)) {
......@@ -2298,7 +2296,7 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
skip:
avio_skip(s->pb, klv.length);
}
return AVERROR_EOF;
return url_feof(s->pb) ? AVERROR_EOF : -1;
}
static int mxf_read_packet(AVFormatContext *s, AVPacket *pkt)
......
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