aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoseph Artsimovich <joseph@mirriad.com>2013-05-08 13:07:41 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-05-13 19:03:04 +0200
commit3967f68053979cbd17f499b8d50e3ea859dd23aa (patch)
treebafc44d8cc9bc95343885f12809754fb5fb4937c
parent1e00bbb10cbde3da03a1e744265ce6def9ae4c56 (diff)
downloadffmpeg-3967f68053979cbd17f499b8d50e3ea859dd23aa.tar.gz
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>
-rw-r--r--libavformat/mxfdec.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 286a884cc7..5f948fa0e3 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -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)