mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
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:
parent
1e00bbb10c
commit
3967f68053
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user