]> git.sesse.net Git - ffmpeg/commitdiff
avformat/mxfdec: use the common packet pts setter function for opatom files
authorMarton Balint <cus@passwd.hu>
Thu, 7 Sep 2017 14:17:59 +0000 (16:17 +0200)
committerMarton Balint <cus@passwd.hu>
Sat, 23 Sep 2017 17:07:54 +0000 (19:07 +0200)
Fixes ticket #6631.

Signed-off-by: Marton Balint <cus@passwd.hu>
libavformat/mxfdec.c

index 3e2f5011ee4277a9aa3c4967526d44c88d97715b..476d284c96718c9821098c03ff8b3c0f34cc2a19 100644 (file)
@@ -3217,15 +3217,9 @@ static int mxf_read_packet(AVFormatContext *s, AVPacket *pkt)
 
     pkt->stream_index = st->index;
 
-    if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && t->ptses &&
-        mxf->current_edit_unit >= 0 && mxf->current_edit_unit < t->nb_ptses) {
-        pkt->dts = mxf->current_edit_unit + t->first_dts;
-        pkt->pts = t->ptses[mxf->current_edit_unit];
-    } else if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
-        int ret = mxf_set_audio_pts(mxf, st->codecpar, pkt);
-        if (ret < 0)
-            return ret;
-    }
+    ret = mxf_set_pts(mxf, st, pkt, next_pos);
+    if (ret < 0)
+        return ret;
 
     mxf->current_edit_unit += edit_units;