mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-17 20:17:55 +02:00
mxfdec: let pkt->pts = mxf->current_edit_unit if intra-only
We cannot do this in general since we could be reading a file with B-frames while lacking an index. Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
parent
634d670538
commit
34ca5ae51d
@ -2000,11 +2000,17 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
|
|||||||
IS_KLV_KEY(klv.key, mxf_avid_essence_element_key)) {
|
IS_KLV_KEY(klv.key, mxf_avid_essence_element_key)) {
|
||||||
int index = mxf_get_stream_index(s, &klv);
|
int index = mxf_get_stream_index(s, &klv);
|
||||||
int64_t next_ofs, next_klv;
|
int64_t next_ofs, next_klv;
|
||||||
|
AVStream *st;
|
||||||
|
MXFTrack *track;
|
||||||
|
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
av_log(s, AV_LOG_ERROR, "error getting stream index %d\n", AV_RB32(klv.key+12));
|
av_log(s, AV_LOG_ERROR, "error getting stream index %d\n", AV_RB32(klv.key+12));
|
||||||
goto skip;
|
goto skip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
st = s->streams[index];
|
||||||
|
track = st->priv_data;
|
||||||
|
|
||||||
if (s->streams[index]->discard == AVDISCARD_ALL)
|
if (s->streams[index]->discard == AVDISCARD_ALL)
|
||||||
goto skip;
|
goto skip;
|
||||||
|
|
||||||
@ -2046,6 +2052,11 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
|
|||||||
mxf->current_edit_unit < t->nb_ptses) {
|
mxf->current_edit_unit < t->nb_ptses) {
|
||||||
pkt->dts = mxf->current_edit_unit + t->first_dts;
|
pkt->dts = mxf->current_edit_unit + t->first_dts;
|
||||||
pkt->pts = t->ptses[mxf->current_edit_unit];
|
pkt->pts = t->ptses[mxf->current_edit_unit];
|
||||||
|
} else if (track->intra_only) {
|
||||||
|
/* intra-only -> PTS = EditUnit.
|
||||||
|
* let utils.c figure out DTS since it can be
|
||||||
|
* < PTS if low_delay = 0 (Sony IMX30) */
|
||||||
|
pkt->pts = mxf->current_edit_unit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user