1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avformat/mxfdec: guess wrapping of tracks by other tracks with the same body sid

This affects the following samples:

samples/ffmpeg-bugs/roundup/issue1775/av_seek_frame_failure.mxf
samples/ffmpeg-bugs/trac/ticket1957/16ch.mxf
samples/ffmpeg-bugs/trac/ticket5016/r0.mxf
samples/ffmpeg-bugs/trac/ticket5016/r1.mxf
samples/ffmpeg-bugs/trac/ticket5316/hq.MXF
samples/ffmpeg-bugs/trac/ticket5316/hqx.MXF

Some AVPacket->pos values are changed because for frame wrapped tracks we point
to the KLV offset and not the data.

Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
Marton Balint 2019-04-07 02:27:49 +02:00
parent a5136426a7
commit 5b6960f955

View File

@ -2553,6 +2553,24 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
}
}
for (int i = 0; i < mxf->fc->nb_streams; i++) {
MXFTrack *track1 = mxf->fc->streams[i]->priv_data;
if (track1 && track1->body_sid) {
for (int j = i + 1; j < mxf->fc->nb_streams; j++) {
MXFTrack *track2 = mxf->fc->streams[j]->priv_data;
if (track2 && track1->body_sid == track2->body_sid && track1->wrapping != track2->wrapping) {
if (track1->wrapping == UnknownWrapped)
track1->wrapping = track2->wrapping;
else if (track2->wrapping == UnknownWrapped)
track2->wrapping = track1->wrapping;
else
av_log(mxf->fc, AV_LOG_ERROR, "stream %d and stream %d have the same BodySID (%d) "
"with different wrapping\n", i, j, track1->body_sid);
}
}
}
}
ret = 0;
fail_and_free:
return ret;