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: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Joseph Artsimovich 2013-05-08 13:07:41 +01:00 committed by Michael Niedermayer
parent 1e00bbb10c
commit 3967f68053
1 changed files with 2 additions and 4 deletions

View File

@ -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)