[FFmpeg-devel] [PATCH 2/2] mxfdec: set audio packets pts

Matthieu Bouron matthieu.bouron at gmail.com
Wed Nov 7 19:06:51 CET 2012


On Fri, Sep 21, 2012 at 03:00:51PM +0200, Tomas Härdin wrote:
> On Thu, 2012-09-20 at 20:31 +0200, Matthieu Bouron wrote:
> > Also fix playback of ntsc files.
> > ---
> >  libavformat/mxfdec.c        | 84 +++++++++++++++++++++++++++++++++++++++++++--
> >  tests/ref/fate/mxf-demux    |  6 ++--
> >  tests/ref/lavf/mxf          |  2 +-
> >  tests/ref/seek/lavf_mxf     | 18 +++++-----
> >  tests/ref/seek/lavf_mxf_d10 | 30 ++++++++--------
> >  5 files changed, 109 insertions(+), 31 deletions(-)
> > 
> > diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
> > index 16b8c12..eb33b67 100644
> > --- a/libavformat/mxfdec.c
> > +++ b/libavformat/mxfdec.c
> > @@ -223,6 +223,8 @@ typedef struct {
> >      int nb_index_tables;
> >      MXFIndexTable *index_tables;
> >      int edit_units_per_packet;      ///< how many edit units to read at a time (PCM, OPAtom)
> > +    AVRational *streams_time_bases;
> > +    uint64_t *streams_samples;
> 
> Why not put a simple AVRational and uint64_t in MXFTrack?

Done in new patch.

> 
> >  } MXFContext;
> >  
> >  enum MXFWrappingScheme {
> > @@ -1431,6 +1433,15 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
> >              ret = AVERROR(ENOMEM);
> >              goto fail_and_free;
> >          }
> > +
> > +        mxf->streams_time_bases = av_realloc_f(mxf->streams_time_bases, mxf->fc->nb_streams, sizeof(*mxf->streams_time_bases));
> > +        mxf->streams_samples = av_realloc_f(mxf->streams_samples, mxf->fc->nb_streams, sizeof(*mxf->streams_samples));
> > +        if (!mxf->streams_time_bases || !mxf->streams_samples) {
> > +            av_log(mxf->fc, AV_LOG_ERROR, "could not allocate stream information\n");
> > +            ret = AVERROR(ENOMEM);
> > +            goto fail_and_free;
> 
> This will leak memory if mxf->streams_time_bases can be allocated but
> mxf->streams_samples can't. Not a problem if you put these in MXFTrack
> of course :)
> 

Done in new patch.

> > +        }
> > +
> >          st->id = source_track->track_id;
> >          st->priv_data = source_track;
> >          st->duration = component->duration;
> > @@ -1438,6 +1449,8 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
> >              st->duration = AV_NOPTS_VALUE;
> >          st->start_time = component->start_position;
> >          avpriv_set_pts_info(st, 64, material_track->edit_rate.den, material_track->edit_rate.num);
> > +        mxf->streams_samples[mxf->fc->nb_streams - 1] = 0;
> > +        mxf->streams_time_bases[mxf->fc->nb_streams - 1] = av_inv_q(material_track->edit_rate);
> >  
> >          PRINT_KEY(mxf->fc, "data definition   ul", source_track->sequence->data_definition_ul);
> >          codec_ul = mxf_get_codec_ul(ff_mxf_data_definition_uls, &source_track->sequence->data_definition_ul);
> > @@ -1541,8 +1554,14 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
> >              st->codec->channels = descriptor->channels;
> >              st->codec->bits_per_coded_sample = descriptor->bits_per_sample;
> >  
> > -            if (descriptor->sample_rate.den > 0)
> > +            if (descriptor->sample_rate.den > 0) {
> > +                st->time_base = av_inv_q(descriptor->sample_rate);
> 
> Shouldn't you modify the call to avpriv_set_pts_info() instead?

Done

> 
> >                  st->codec->sample_rate = descriptor->sample_rate.num / descriptor->sample_rate.den;
> > +            } else {
> > +                av_log(mxf->fc, AV_LOG_WARNING, "invalid sample rate (%d/%d) found for stream #%d, time base forced to 1/48000\n",
> > +                       descriptor->sample_rate.num, descriptor->sample_rate.den, st->index);
> > +                st->time_base = (AVRational){1, 48000};
> 
> Seems relatively reasonable, apart from the avpriv_set_pts_info() thing.
> 
> > +            }
> >  
> >              /* TODO: implement AV_CODEC_ID_RAWAUDIO */
> >              if (st->codec->codec_id == AV_CODEC_ID_PCM_S16LE) {
> > @@ -1982,6 +2001,52 @@ static int64_t mxf_set_current_edit_unit(MXFContext *mxf, int64_t current_offset
> >      return next_ofs;
> >  }
> >  
> > +static int mxf_compute_sample_count(MXFContext *mxf, int stream_index, uint64_t *sample_count)
> > +{
> > +    int i, total = 0, size = 0;
> > +    AVRational time_base = mxf->streams_time_bases[stream_index];
> > +    const MXFSamplesPerFrame *spf;
> > +
> > +    spf = ff_mxf_get_samples_per_frame(mxf->fc, time_base);
> > +    if (!spf) {
> > +        av_log(mxf->fc, AV_LOG_ERROR, "unsupported codec time base %d/%d",
> > +               time_base.num, time_base.den);
> > +        return AVERROR(EINVAL);
> 
> This seems a bit harsh - could we fall back to the old code instead?
> That or just compute samples_per_frames - nag only if the edit rate
> doesn't divide sample_rate.
> 
> > +    }
> > +
> > +    while (spf->samples_per_frame[size]) {
> > +        total += spf->samples_per_frame[size];
> > +        size++;
> > +    }
> > +
> > +    if (!size)
> > +        return AVERROR(EINVAL);
> 
> It seems like this can never happen - I'd av_assert() here (assuming I
> understand correctly).
> 
> > +    *sample_count = (mxf->current_edit_unit / size) * total;
> > +    for (i = 0; i < mxf->current_edit_unit % size; i++) {
> > +        *sample_count += spf->samples_per_frame[i];
> > +    }
> > +    return 0;
> > +}
> > +
> > +static int mxf_set_audio_pts(MXFContext *mxf, AVCodecContext *codec, AVPacket *pkt)
> > +{
> > +    int index = pkt->stream_index;
> > +    uint64_t current_sample_count = 0;
> > +    int ret = mxf_compute_sample_count(mxf, index, &current_sample_count);
> > +    if (ret < 0)
> > +        return ret;
> > +
> > +    // read sample count and computed sample count max difference is 1 at most
> > +    if (fabs(current_sample_count - mxf->streams_samples[index]) > 1)
> 
> FFABS()
> 
> > +        mxf->streams_samples[index] = current_sample_count;
> 
> This should only happen during seeking. You should always extrapolate
> when demuxing straight ahead, else the packet durations (delta pts)
> don't match pkt->size/(channels*bytes_per_sample).
> 
> > +
> > +    pkt->pts = mxf->streams_samples[index];
> > +    mxf->streams_samples[index] += pkt->size / (codec->channels * av_get_bits_per_sample(codec->codec_id) / 8);
> 
> Isn't there a function to get number of *bytes* per sample?

The function exists, however it returns the number of bytes used to store
the value: 8, 16, 32, ...

> 
> > +    return 0;
> > +}
> > +
> >  static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
> >  {
> >      KLVPacket klv;
> > @@ -2007,6 +2072,7 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
> >              int64_t next_ofs, next_klv;
> >              AVStream *st;
> >              MXFTrack *track;
> > +            AVCodecContext *codec;
> >  
> >              if (index < 0) {
> >                  av_log(s, AV_LOG_ERROR, "error getting stream index %d\n", AV_RB32(klv.key+12));
> > @@ -2045,7 +2111,8 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
> >              pkt->stream_index = index;
> >              pkt->pos = klv.offset;
> >  
> > -            if (s->streams[index]->codec->codec_type == AVMEDIA_TYPE_VIDEO && next_ofs >= 0) {
> > +            codec = s->streams[index]->codec;
> > +            if (codec->codec_type == AVMEDIA_TYPE_VIDEO && next_ofs >= 0) {
> >                  /* mxf->current_edit_unit good - see if we have an index table to derive timestamps from */
> >                  MXFIndexTable *t = &mxf->index_tables[0];
> >  
> > @@ -2057,6 +2124,10 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
> >                       * let utils.c figure out DTS since it can be < PTS if low_delay = 0 (Sony IMX30) */
> >                      pkt->pts = mxf->current_edit_unit;
> >                  }
> > +            } else if (codec->codec_type == AVMEDIA_TYPE_AUDIO && next_ofs >= 0) {
> > +                int ret = mxf_set_audio_pts(mxf, codec, pkt);
> > +                if (ret < 0)
> > +                    return ret;
> 
> Looks reasonable. I assume you tested with OP1a.
> 
> >              }
> >  
> >              /* seek for truncated packets */
> > @@ -2114,13 +2185,18 @@ static int mxf_read_packet(AVFormatContext *s, AVPacket *pkt)
> >      if ((size = av_get_packet(s->pb, pkt, size)) < 0)
> >          return size;
> >  
> > +    pkt->stream_index = 0;
> > +
> 
> Why move this?
> 
> >      if (st->codec->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->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
> > +        int ret = mxf_set_audio_pts(mxf, st->codec, pkt);
> > +        if (ret < 0)
> > +            return ret;
> 
> Did you test OPAtom?
> 
> Overall this looks very promising :)
> 

Hello,

Here is a second version of the patch.
Stream sample count is only computed in case of seeking.
ff_mxf_get_samples_per_frames is only used if sample rate is 48000Hz.
If samples rate differs from 48000Hz, the value is computed but might not
be accurate if the time base does not devide the sample rate.

Regards,
Matthieu

[...]
-------------- next part --------------
>From 466d6e5f641469e620a8e46b45a8e5e6e256edd1 Mon Sep 17 00:00:00 2001
From: Matthieu Bouron <matthieu.bouron at gmail.com>
Date: Thu, 13 Sep 2012 21:15:48 +0200
Subject: [PATCH] mxfdec: set audio packets pts

Also fix playback of ntsc files.
---
 libavformat/mxfdec.c        | 82 +++++++++++++++++++++++++++++++++++++++++++--
 tests/ref/fate/mxf-demux    |  6 ++--
 tests/ref/lavf/mxf          |  2 +-
 tests/ref/seek/lavf_mxf     | 18 +++++-----
 tests/ref/seek/lavf_mxf_d10 | 30 ++++++++---------
 5 files changed, 107 insertions(+), 31 deletions(-)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index b7c0826..b3f6165 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -46,6 +46,7 @@
 //#define DEBUG
 
 #include "libavutil/aes.h"
+#include "libavutil/avassert.h"
 #include "libavutil/mathematics.h"
 #include "libavcodec/bytestream.h"
 #include "libavutil/timecode.h"
@@ -132,6 +133,8 @@ typedef struct {
     uint8_t track_number[4];
     AVRational edit_rate;
     int intra_only;
+    AVRational time_base;
+    uint64_t sample_count;
 } MXFTrack;
 
 typedef struct {
@@ -1441,6 +1444,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
             st->duration = AV_NOPTS_VALUE;
         st->start_time = component->start_position;
         avpriv_set_pts_info(st, 64, material_track->edit_rate.den, material_track->edit_rate.num);
+        source_track->time_base = av_inv_q(material_track->edit_rate);
 
         PRINT_KEY(mxf->fc, "data definition   ul", source_track->sequence->data_definition_ul);
         codec_ul = mxf_get_codec_ul(ff_mxf_data_definition_uls, &source_track->sequence->data_definition_ul);
@@ -1545,8 +1549,14 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
             st->codec->channels = descriptor->channels;
             st->codec->bits_per_coded_sample = descriptor->bits_per_sample;
 
-            if (descriptor->sample_rate.den > 0)
+            if (descriptor->sample_rate.den > 0) {
+                avpriv_set_pts_info(st, 64, descriptor->sample_rate.den, descriptor->sample_rate.num);
                 st->codec->sample_rate = descriptor->sample_rate.num / descriptor->sample_rate.den;
+            } else {
+                av_log(mxf->fc, AV_LOG_WARNING, "invalid sample rate (%d/%d) found for stream #%d, time base forced to 1/48000\n",
+                       descriptor->sample_rate.num, descriptor->sample_rate.den, st->index);
+                avpriv_set_pts_info(st, 64, 1, 48000);
+            }
 
             /* TODO: implement AV_CODEC_ID_RAWAUDIO */
             if (st->codec->codec_id == AV_CODEC_ID_PCM_S16LE) {
@@ -1986,6 +1996,50 @@ static int64_t mxf_set_current_edit_unit(MXFContext *mxf, int64_t current_offset
     return next_ofs;
 }
 
+static int mxf_compute_sample_count(MXFContext *mxf, int stream_index, uint64_t *sample_count)
+{
+    int i, total = 0, size = 0;
+    AVStream *st = mxf->fc->streams[stream_index];
+    MXFTrack *track = st->priv_data;
+    AVRational time_base = track->time_base;
+    AVRational sample_rate = st->time_base;
+    const MXFSamplesPerFrame *spf = NULL;
+
+    if (av_q2d(sample_rate) == 48000)
+        spf = ff_mxf_get_samples_per_frame(mxf->fc, time_base);
+    if (!spf) {
+        int remainder = (sample_rate.num * time_base.den) % (time_base.num * sample_rate.den);
+        *sample_count = mxf->current_edit_unit * (av_q2d(sample_rate) / av_q2d(time_base));
+        if (remainder)
+            av_log(mxf->fc, AV_LOG_WARNING,
+                   "seeking detected on stream #\d with time base (%d/%d) and sample rate (%d/%d), audio pts won't be accurate.\n",
+                   stream_index, time_base.num, time_base.den, sample_rate.num, sample_rate.den);
+        return 0;
+    }
+
+    while (spf->samples_per_frame[size]) {
+        total += spf->samples_per_frame[size];
+        size++;
+    }
+
+    av_assert2(size);
+
+    *sample_count = (mxf->current_edit_unit / size) * total;
+    for (i = 0; i < mxf->current_edit_unit % size; i++) {
+        *sample_count += spf->samples_per_frame[i];
+    }
+
+    return 0;
+}
+
+static int mxf_set_audio_pts(MXFContext *mxf, AVCodecContext *codec, AVPacket *pkt)
+{
+    MXFTrack *track = mxf->fc->streams[pkt->stream_index]->priv_data;
+    pkt->pts = track->sample_count;
+    track->sample_count += pkt->size / (codec->channels * av_get_bits_per_sample(codec->codec_id) / 8);
+    return 0;
+}
+
 static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
 {
     KLVPacket klv;
@@ -2011,6 +2065,7 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
             int64_t next_ofs, next_klv;
             AVStream *st;
             MXFTrack *track;
+            AVCodecContext *codec;
 
             if (index < 0) {
                 av_log(s, AV_LOG_ERROR, "error getting stream index %d\n", AV_RB32(klv.key+12));
@@ -2049,7 +2104,8 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
             pkt->stream_index = index;
             pkt->pos = klv.offset;
 
-            if (s->streams[index]->codec->codec_type == AVMEDIA_TYPE_VIDEO && next_ofs >= 0) {
+            codec = s->streams[index]->codec;
+            if (codec->codec_type == AVMEDIA_TYPE_VIDEO && next_ofs >= 0) {
                 /* mxf->current_edit_unit good - see if we have an index table to derive timestamps from */
                 MXFIndexTable *t = &mxf->index_tables[0];
 
@@ -2061,6 +2117,10 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
                      * let utils.c figure out DTS since it can be < PTS if low_delay = 0 (Sony IMX30) */
                     pkt->pts = mxf->current_edit_unit;
                 }
+            } else if (codec->codec_type == AVMEDIA_TYPE_AUDIO && next_ofs >= 0) {
+                int ret = mxf_set_audio_pts(mxf, codec, pkt);
+                if (ret < 0)
+                    return ret;
             }
 
             /* seek for truncated packets */
@@ -2118,13 +2178,18 @@ static int mxf_read_packet(AVFormatContext *s, AVPacket *pkt)
     if ((size = av_get_packet(s->pb, pkt, size)) < 0)
         return size;
 
+    pkt->stream_index = 0;
+
     if (st->codec->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->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
+        int ret = mxf_set_audio_pts(mxf, st->codec, pkt);
+        if (ret < 0)
+            return ret;
     }
 
-    pkt->stream_index = 0;
     mxf->current_edit_unit += edit_units;
 
     return 0;
@@ -2200,6 +2265,8 @@ static int mxf_probe(AVProbeData *p) {
 static int mxf_read_seek(AVFormatContext *s, int stream_index, int64_t sample_time, int flags)
 {
     AVStream *st = s->streams[stream_index];
+    MXFTrack *track = st->priv_data;
+    uint64_t current_sample_count;
     int64_t seconds;
     MXFContext* mxf = s->priv_data;
     int64_t seekpos;
@@ -2240,6 +2307,15 @@ static int mxf_read_seek(AVFormatContext *s, int stream_index, int64_t sample_ti
         mxf->current_edit_unit = sample_time;
         avio_seek(s->pb, seekpos, SEEK_SET);
     }
+
+    // Update track sample count
+    if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
+        ret = mxf_compute_sample_count(mxf, stream_index, &current_sample_count);
+        if (ret < 0)
+            return ret;
+
+        track->sample_count = current_sample_count;
+    }
     return 0;
 }
 
diff --git a/tests/ref/fate/mxf-demux b/tests/ref/fate/mxf-demux
index c67c4ab..454722e 100644
--- a/tests/ref/fate/mxf-demux
+++ b/tests/ref/fate/mxf-demux
@@ -1,7 +1,7 @@
 #tb 0: 1/25
-#tb 1: 1/25
+#tb 1: 1/8000
 0,          0, -9223372036854775808,        1,     8468, 0xc0855553
-1,          0,          0,       50,    32000, 0x479155e6
+1,          0,          0,    16000,    32000, 0x479155e6
 0,          1, -9223372036854775808,        1,     3814, 0xa10783b4, F=0x0
 0,          2, -9223372036854775808,        1,     3747, 0xb7bf6973, F=0x0
 0,          3, -9223372036854775808,        1,     3705, 0x5462a600, F=0x0
@@ -52,7 +52,7 @@
 0,         48, -9223372036854775808,        1,     3688, 0x1db45852, F=0x0
 0,         49, -9223372036854775808,        1,    38412, 0x2ee26a63, F=0x0
 0,         50, -9223372036854775808,        1,     8385, 0x0bc20a27
-1,         50,         50,       50,    32000, 0x8f7e5009
+1,      16000,      16000,    16000,    32000, 0x8f7e5009
 0,         51, -9223372036854775808,        1,     3733, 0xa3e2a9a0, F=0x0
 0,         52, -9223372036854775808,        1,     3773, 0x27769caa, F=0x0
 0,         53, -9223372036854775808,        1,     3670, 0xc8335e98, F=0x0
diff --git a/tests/ref/lavf/mxf b/tests/ref/lavf/mxf
index d8aeb4a..e1473cc 100644
--- a/tests/ref/lavf/mxf
+++ b/tests/ref/lavf/mxf
@@ -3,7 +3,7 @@
 ./tests/data/lavf/lavf.mxf CRC=0x17ce1069
 830a8b9ee58781bf654c55905067cdae *./tests/data/lavf/lavf.mxf
 554553 ./tests/data/lavf/lavf.mxf
-./tests/data/lavf/lavf.mxf CRC=0xa3c0dbc4
+./tests/data/lavf/lavf.mxf CRC=0x468cdbc4
 10c6ae1bd97c851728c9abad9dddfa2e *./tests/data/lavf/lavf.mxf
 525369 ./tests/data/lavf/lavf.mxf
 ./tests/data/lavf/lavf.mxf CRC=0x17ce1069
diff --git a/tests/ref/seek/lavf_mxf b/tests/ref/seek/lavf_mxf
index f7d1f67..34dddc3 100644
--- a/tests/ref/seek/lavf_mxf
+++ b/tests/ref/seek/lavf_mxf
@@ -7,8 +7,8 @@ ret: 0         st: 0 flags:0  ts: 0.800000
 ret: 0         st: 0 flags:1 dts: 0.840000 pts: 0.960000 pos: 460288 size: 24711
 ret: 0         st: 0 flags:1  ts:-0.320000
 ret: 0         st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos:   6144 size: 24801
-ret:-1         st: 1 flags:0  ts: 2.560000
-ret: 0         st: 1 flags:1  ts: 1.480000
+ret:-1         st: 1 flags:0  ts: 2.576667
+ret: 0         st: 1 flags:1  ts: 1.470833
 ret: 0         st: 0 flags:1 dts: 0.840000 pts: 0.960000 pos: 460288 size: 24711
 ret: 0         st:-1 flags:0  ts: 0.365002
 ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.480000 pos: 211456 size: 24786
@@ -17,9 +17,9 @@ ret: 0         st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos:   6144 size: 24801
 ret:-1         st: 0 flags:0  ts: 2.160000
 ret: 0         st: 0 flags:1  ts: 1.040000
 ret: 0         st: 0 flags:1 dts: 0.840000 pts: 0.960000 pos: 460288 size: 24711
-ret: 0         st: 1 flags:0  ts:-0.040000
+ret: 0         st: 1 flags:0  ts:-0.058333
 ret: 0         st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos:   6144 size: 24801
-ret: 0         st: 1 flags:1  ts: 2.840000
+ret: 0         st: 1 flags:1  ts: 2.835833
 ret: 0         st: 0 flags:1 dts: 0.840000 pts: 0.960000 pos: 460288 size: 24711
 ret:-1         st:-1 flags:0  ts: 1.730004
 ret: 0         st:-1 flags:1  ts: 0.624171
@@ -28,9 +28,9 @@ ret: 0         st: 0 flags:0  ts:-0.480000
 ret: 0         st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos:   6144 size: 24801
 ret: 0         st: 0 flags:1  ts: 2.400000
 ret: 0         st: 0 flags:1 dts: 0.840000 pts: 0.960000 pos: 460288 size: 24711
-ret:-1         st: 1 flags:0  ts: 1.320000
-ret: 0         st: 1 flags:1  ts: 0.200000
-ret: 0         st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos:   6144 size: 24801
+ret:-1         st: 1 flags:0  ts: 1.306667
+ret: 0         st: 1 flags:1  ts: 0.200833
+ret: 0         st: 0 flags:1 dts: 0.840000 pts: 0.960000 pos: 460288 size: 24711
 ret: 0         st:-1 flags:0  ts:-0.904994
 ret: 0         st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos:   6144 size: 24801
 ret: 0         st:-1 flags:1  ts: 1.989173
@@ -39,8 +39,8 @@ ret: 0         st: 0 flags:0  ts: 0.880000
 ret: 0         st: 0 flags:1 dts: 0.840000 pts: 0.960000 pos: 460288 size: 24711
 ret: 0         st: 0 flags:1  ts:-0.240000
 ret: 0         st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos:   6144 size: 24801
-ret:-1         st: 1 flags:0  ts: 2.680000
-ret: 0         st: 1 flags:1  ts: 1.560000
+ret:-1         st: 1 flags:0  ts: 2.671667
+ret: 0         st: 1 flags:1  ts: 1.565833
 ret: 0         st: 0 flags:1 dts: 0.840000 pts: 0.960000 pos: 460288 size: 24711
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.840000 pts: 0.960000 pos: 460288 size: 24711
diff --git a/tests/ref/seek/lavf_mxf_d10 b/tests/ref/seek/lavf_mxf_d10
index 4cfe595..e091c77 100644
--- a/tests/ref/seek/lavf_mxf_d10
+++ b/tests/ref/seek/lavf_mxf_d10
@@ -7,10 +7,10 @@ ret: 0         st: 0 flags:0  ts: 0.800000
 ret: 0         st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos:4265984 size:150000
 ret: 0         st: 0 flags:1  ts:-0.320000
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   6144 size:150000
-ret: 0         st: 1 flags:0  ts: 2.560000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:5117952 size:150000
-ret: 0         st: 1 flags:1  ts: 1.480000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:5117952 size:150000
+ret: 0         st: 1 flags:0  ts: 2.576667
+ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:5117952 size:150000
+ret: 0         st: 1 flags:1  ts: 1.470833
+ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:5117952 size:150000
 ret: 0         st:-1 flags:0  ts: 0.365002
 ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos:1923072 size:150000
 ret: 0         st:-1 flags:1  ts:-0.740831
@@ -19,10 +19,10 @@ ret: 0         st: 0 flags:0  ts: 2.160000
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:5117952 size:150000
 ret: 0         st: 0 flags:1  ts: 1.040000
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:5117952 size:150000
-ret: 0         st: 1 flags:0  ts:-0.040000
+ret: 0         st: 1 flags:0  ts:-0.058333
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   6144 size:150000
-ret: 0         st: 1 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:5117952 size:150000
+ret: 0         st: 1 flags:1  ts: 2.835833
+ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:5117952 size:150000
 ret: 0         st:-1 flags:0  ts: 1.730004
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:5117952 size:150000
 ret: 0         st:-1 flags:1  ts: 0.624171
@@ -31,10 +31,10 @@ ret: 0         st: 0 flags:0  ts:-0.480000
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   6144 size:150000
 ret: 0         st: 0 flags:1  ts: 2.400000
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:5117952 size:150000
-ret: 0         st: 1 flags:0  ts: 1.320000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:5117952 size:150000
-ret: 0         st: 1 flags:1  ts: 0.200000
-ret: 0         st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos:1071104 size:150000
+ret: 0         st: 1 flags:0  ts: 1.306667
+ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:5117952 size:150000
+ret: 0         st: 1 flags:1  ts: 0.200833
+ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:5117952 size:150000
 ret: 0         st:-1 flags:0  ts:-0.904994
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   6144 size:150000
 ret: 0         st:-1 flags:1  ts: 1.989173
@@ -43,10 +43,10 @@ ret: 0         st: 0 flags:0  ts: 0.880000
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos:4691968 size:150000
 ret: 0         st: 0 flags:1  ts:-0.240000
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   6144 size:150000
-ret: 0         st: 1 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:5117952 size:150000
-ret: 0         st: 1 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:5117952 size:150000
+ret: 0         st: 1 flags:0  ts: 2.671667
+ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:5117952 size:150000
+ret: 0         st: 1 flags:1  ts: 1.565833
+ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:5117952 size:150000
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:2562048 size:150000
 ret: 0         st:-1 flags:1  ts:-0.645825
-- 
1.8.0



More information about the ffmpeg-devel mailing list