mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-04 06:08:26 +02:00
Merge commit '5b977c1d4fd99f325049d48fb8f0a3240d50eef8'
* commit '5b977c1d4fd99f325049d48fb8f0a3240d50eef8': mxf: Return meaningful errors Conflicts: libavformat/mxfdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
39f5003a07
@ -2297,16 +2297,16 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
|
||||
{
|
||||
KLVPacket klv;
|
||||
MXFContext *mxf = s->priv_data;
|
||||
int ret;
|
||||
|
||||
while (klv_read_packet(&klv, s->pb) == 0) {
|
||||
int ret;
|
||||
while ((ret = klv_read_packet(&klv, s->pb)) == 0) {
|
||||
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)) {
|
||||
ret = mxf_decrypt_triplet(s, pkt, &klv);
|
||||
if (ret < 0) {
|
||||
av_log(s, AV_LOG_ERROR, "invalid encoded triplet\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
return ret;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -2345,9 +2345,11 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
|
||||
|
||||
/* check for 8 channels AES3 element */
|
||||
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");
|
||||
return AVERROR_INVALIDDATA;
|
||||
return ret;
|
||||
}
|
||||
} else {
|
||||
ret = av_get_packet(s->pb, pkt, klv.length);
|
||||
@ -2373,7 +2375,7 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
|
||||
pkt->pts = mxf->current_edit_unit;
|
||||
}
|
||||
} 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)
|
||||
return ret;
|
||||
}
|
||||
@ -2386,7 +2388,7 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
|
||||
skip:
|
||||
avio_skip(s->pb, klv.length);
|
||||
}
|
||||
return url_feof(s->pb) ? AVERROR_EOF : -1;
|
||||
return url_feof(s->pb) ? AVERROR_EOF : ret;
|
||||
}
|
||||
|
||||
static int mxf_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
|
Loading…
x
Reference in New Issue
Block a user