aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-03-18 17:58:49 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-03-18 17:58:58 +0100
commit4eb41d16bee406d1481d412639230510015ea708 (patch)
treec6fa80c3b060c6a71c43082802974163c911663b
parent12bcfe05b45175cc7fc5cc719392c35ee5a3c39c (diff)
parent350785a6621529c50771f4e7043b4d159a96ed26 (diff)
downloadffmpeg-4eb41d16bee406d1481d412639230510015ea708.tar.gz
Merge remote-tracking branch 'newdev/master'
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/aacpsy.c2
-rw-r--r--libavcodec/ac3dsp.c21
-rw-r--r--libavcodec/ac3dsp.h17
-rw-r--r--libavcodec/ac3enc.c2
-rw-r--r--libavcodec/ac3enc_float.c5
-rw-r--r--libavcodec/x86/ac3dsp.asm115
-rw-r--r--libavcodec/x86/ac3dsp_mmx.c15
-rw-r--r--libavformat/asfdec.c3
-rw-r--r--libavformat/avformat.h2
-rw-r--r--libavformat/nutenc.c1
-rw-r--r--tests/ref/seek/lavf_asf60
-rw-r--r--tests/ref/seek/wmav1_asf54
-rw-r--r--tests/ref/seek/wmav2_asf54
13 files changed, 251 insertions, 100 deletions
diff --git a/libavcodec/aacpsy.c b/libavcodec/aacpsy.c
index d9896ed74f..9938e3710a 100644
--- a/libavcodec/aacpsy.c
+++ b/libavcodec/aacpsy.c
@@ -397,7 +397,7 @@ static void psy_3gpp_analyze(FFPsyContext *ctx, int channel,
int i, w, g;
const int num_bands = ctx->num_bands[wi->num_windows == 8];
const uint8_t *band_sizes = ctx->bands[wi->num_windows == 8];
- AacPsyCoeffs *coeffs = &pctx->psy_coef[wi->num_windows == 8];
+ AacPsyCoeffs *coeffs = pctx->psy_coef[wi->num_windows == 8];
//calculate energies, initial thresholds and related values - 5.4.2 "Threshold Calculation"
for (w = 0; w < wi->num_windows*16; w += 16) {
diff --git a/libavcodec/ac3dsp.c b/libavcodec/ac3dsp.c
index 4d9db9be50..9bfa7300e3 100644
--- a/libavcodec/ac3dsp.c
+++ b/libavcodec/ac3dsp.c
@@ -85,13 +85,30 @@ static void ac3_rshift_int32_c(int32_t *src, unsigned int len,
} while (len > 0);
}
-av_cold void ff_ac3dsp_init(AC3DSPContext *c)
+static void float_to_fixed24_c(int32_t *dst, const float *src, unsigned int len)
+{
+ const float scale = 1 << 24;
+ do {
+ *dst++ = lrintf(*src++ * scale);
+ *dst++ = lrintf(*src++ * scale);
+ *dst++ = lrintf(*src++ * scale);
+ *dst++ = lrintf(*src++ * scale);
+ *dst++ = lrintf(*src++ * scale);
+ *dst++ = lrintf(*src++ * scale);
+ *dst++ = lrintf(*src++ * scale);
+ *dst++ = lrintf(*src++ * scale);
+ len -= 8;
+ } while (len > 0);
+}
+
+av_cold void ff_ac3dsp_init(AC3DSPContext *c, int bit_exact)
{
c->ac3_exponent_min = ac3_exponent_min_c;
c->ac3_max_msb_abs_int16 = ac3_max_msb_abs_int16_c;
c->ac3_lshift_int16 = ac3_lshift_int16_c;
c->ac3_rshift_int32 = ac3_rshift_int32_c;
+ c->float_to_fixed24 = float_to_fixed24_c;
if (HAVE_MMX)
- ff_ac3dsp_init_x86(c);
+ ff_ac3dsp_init_x86(c, bit_exact);
}
diff --git a/libavcodec/ac3dsp.h b/libavcodec/ac3dsp.h
index 31a0af375d..0a2dedf478 100644
--- a/libavcodec/ac3dsp.h
+++ b/libavcodec/ac3dsp.h
@@ -68,9 +68,22 @@ typedef struct AC3DSPContext {
* constraints: range [0,31]
*/
void (*ac3_rshift_int32)(int32_t *src, unsigned int len, unsigned int shift);
+
+ /**
+ * Convert an array of float in range [-1.0,1.0] to int32_t with range
+ * [-(1<<24),(1<<24)]
+ *
+ * @param dst destination array of int32_t.
+ * constraints: 16-byte aligned
+ * @param src source array of float.
+ * constraints: 16-byte aligned
+ * @param len number of elements to convert.
+ * constraints: multiple of 32 greater than zero
+ */
+ void (*float_to_fixed24)(int32_t *dst, const float *src, unsigned int len);
} AC3DSPContext;
-void ff_ac3dsp_init (AC3DSPContext *c);
-void ff_ac3dsp_init_x86(AC3DSPContext *c);
+void ff_ac3dsp_init (AC3DSPContext *c, int bit_exact);
+void ff_ac3dsp_init_x86(AC3DSPContext *c, int bit_exact);
#endif /* AVCODEC_AC3DSP_H */
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index 4c01fe3cbd..5b76ae6735 100644
--- a/libavcodec/ac3enc.c
+++ b/libavcodec/ac3enc.c
@@ -1843,7 +1843,7 @@ static av_cold int ac3_encode_init(AVCodecContext *avctx)
avctx->coded_frame= avcodec_alloc_frame();
dsputil_init(&s->dsp, avctx);
- ff_ac3dsp_init(&s->ac3dsp);
+ ff_ac3dsp_init(&s->ac3dsp, avctx->flags & CODEC_FLAG_BITEXACT);
return 0;
init_fail:
diff --git a/libavcodec/ac3enc_float.c b/libavcodec/ac3enc_float.c
index 8668b2e033..4b13e4c723 100644
--- a/libavcodec/ac3enc_float.c
+++ b/libavcodec/ac3enc_float.c
@@ -103,9 +103,8 @@ static int normalize_samples(AC3EncodeContext *s)
*/
static void scale_coefficients(AC3EncodeContext *s)
{
- int i;
- for (i = 0; i < AC3_MAX_COEFS * AC3_MAX_BLOCKS * s->channels; i++)
- s->fixed_coef_buffer[i] = SCALE_FLOAT(s->mdct_coef_buffer[i], 24);
+ s->ac3dsp.float_to_fixed24(s->fixed_coef_buffer, s->mdct_coef_buffer,
+ AC3_MAX_COEFS * AC3_MAX_BLOCKS * s->channels);
}
diff --git a/libavcodec/x86/ac3dsp.asm b/libavcodec/x86/ac3dsp.asm
index e281791b1e..8b7e826a2d 100644
--- a/libavcodec/x86/ac3dsp.asm
+++ b/libavcodec/x86/ac3dsp.asm
@@ -22,6 +22,11 @@
%include "x86inc.asm"
%include "x86util.asm"
+SECTION_RODATA
+
+; 16777216.0f - used in ff_float_to_fixed24()
+pf_1_24: times 4 dd 0x4B800000
+
SECTION .text
;-----------------------------------------------------------------------------
@@ -178,3 +183,113 @@ INIT_MMX
AC3_SHIFT r, 32, psrad, mmx
INIT_XMM
AC3_SHIFT r, 32, psrad, sse2
+
+;-----------------------------------------------------------------------------
+; void ff_float_to_fixed24(int32_t *dst, const float *src, unsigned int len)
+;-----------------------------------------------------------------------------
+
+; The 3DNow! version is not bit-identical because pf2id uses truncation rather
+; than round-to-nearest.
+INIT_MMX
+cglobal float_to_fixed24_3dnow, 3,3,0, dst, src, len
+ movq m0, [pf_1_24]
+.loop:
+ movq m1, [srcq ]
+ movq m2, [srcq+8 ]
+ movq m3, [srcq+16]
+ movq m4, [srcq+24]
+ pfmul m1, m0
+ pfmul m2, m0
+ pfmul m3, m0
+ pfmul m4, m0
+ pf2id m1, m1
+ pf2id m2, m2
+ pf2id m3, m3
+ pf2id m4, m4
+ movq [dstq ], m1
+ movq [dstq+8 ], m2
+ movq [dstq+16], m3
+ movq [dstq+24], m4
+ add srcq, 32
+ add dstq, 32
+ sub lend, 8
+ ja .loop
+ REP_RET
+
+INIT_XMM
+cglobal float_to_fixed24_sse, 3,3,3, dst, src, len
+ movaps m0, [pf_1_24]
+.loop:
+ movaps m1, [srcq ]
+ movaps m2, [srcq+16]
+ mulps m1, m0
+ mulps m2, m0
+ cvtps2pi mm0, m1
+ movhlps m1, m1
+ cvtps2pi mm1, m1
+ cvtps2pi mm2, m2
+ movhlps m2, m2
+ cvtps2pi mm3, m2
+ movq [dstq ], mm0
+ movq [dstq+ 8], mm1
+ movq [dstq+16], mm2
+ movq [dstq+24], mm3
+ add srcq, 32
+ add dstq, 32
+ sub lend, 8
+ ja .loop
+ REP_RET
+
+INIT_XMM
+cglobal float_to_fixed24_sse2, 3,3,9, dst, src, len
+ movaps m0, [pf_1_24]
+.loop:
+ movaps m1, [srcq ]
+ movaps m2, [srcq+16 ]
+ movaps m3, [srcq+32 ]
+ movaps m4, [srcq+48 ]
+%ifdef m8
+ movaps m5, [srcq+64 ]
+ movaps m6, [srcq+80 ]
+ movaps m7, [srcq+96 ]
+ movaps m8, [srcq+112]
+%endif
+ mulps m1, m0
+ mulps m2, m0
+ mulps m3, m0
+ mulps m4, m0
+%ifdef m8
+ mulps m5, m0
+ mulps m6, m0
+ mulps m7, m0
+ mulps m8, m0
+%endif
+ cvtps2dq m1, m1
+ cvtps2dq m2, m2
+ cvtps2dq m3, m3
+ cvtps2dq m4, m4
+%ifdef m8
+ cvtps2dq m5, m5
+ cvtps2dq m6, m6
+ cvtps2dq m7, m7
+ cvtps2dq m8, m8
+%endif
+ movdqa [dstq ], m1
+ movdqa [dstq+16 ], m2
+ movdqa [dstq+32 ], m3
+ movdqa [dstq+48 ], m4
+%ifdef m8
+ movdqa [dstq+64 ], m5
+ movdqa [dstq+80 ], m6
+ movdqa [dstq+96 ], m7
+ movdqa [dstq+112], m8
+ add srcq, 128
+ add dstq, 128
+ sub lenq, 32
+%else
+ add srcq, 64
+ add dstq, 64
+ sub lenq, 16
+%endif
+ ja .loop
+ REP_RET
diff --git a/libavcodec/x86/ac3dsp_mmx.c b/libavcodec/x86/ac3dsp_mmx.c
index 835b10696d..97d0657aa6 100644
--- a/libavcodec/x86/ac3dsp_mmx.c
+++ b/libavcodec/x86/ac3dsp_mmx.c
@@ -38,7 +38,11 @@ extern void ff_ac3_lshift_int16_sse2(int16_t *src, unsigned int len, unsigned in
extern void ff_ac3_rshift_int32_mmx (int32_t *src, unsigned int len, unsigned int shift);
extern void ff_ac3_rshift_int32_sse2(int32_t *src, unsigned int len, unsigned int shift);
-av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c)
+extern void ff_float_to_fixed24_3dnow(int32_t *dst, const float *src, unsigned int len);
+extern void ff_float_to_fixed24_sse (int32_t *dst, const float *src, unsigned int len);
+extern void ff_float_to_fixed24_sse2 (int32_t *dst, const float *src, unsigned int len);
+
+av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c, int bit_exact)
{
int mm_flags = av_get_cpu_flags();
@@ -49,13 +53,22 @@ av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c)
c->ac3_lshift_int16 = ff_ac3_lshift_int16_mmx;
c->ac3_rshift_int32 = ff_ac3_rshift_int32_mmx;
}
+ if (mm_flags & AV_CPU_FLAG_3DNOW && HAVE_AMD3DNOW) {
+ if (!bit_exact) {
+ c->float_to_fixed24 = ff_float_to_fixed24_3dnow;
+ }
+ }
if (mm_flags & AV_CPU_FLAG_MMX2 && HAVE_MMX2) {
c->ac3_exponent_min = ff_ac3_exponent_min_mmxext;
c->ac3_max_msb_abs_int16 = ff_ac3_max_msb_abs_int16_mmxext;
}
+ if (mm_flags & AV_CPU_FLAG_SSE && HAVE_SSE) {
+ c->float_to_fixed24 = ff_float_to_fixed24_sse;
+ }
if (mm_flags & AV_CPU_FLAG_SSE2 && HAVE_SSE) {
c->ac3_exponent_min = ff_ac3_exponent_min_sse2;
c->ac3_max_msb_abs_int16 = ff_ac3_max_msb_abs_int16_sse2;
+ c->float_to_fixed24 = ff_float_to_fixed24_sse2;
if (!(mm_flags & AV_CPU_FLAG_SSE2SLOW)) {
c->ac3_lshift_int16 = ff_ac3_lshift_int16_sse2;
c->ac3_rshift_int32 = ff_ac3_rshift_int32_sse2;
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index 7d08e6ebcf..cdde5ae3e9 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -235,6 +235,7 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size)
if (!asf_st)
return AVERROR(ENOMEM);
st->priv_data = asf_st;
+ st->start_time = 0;
start_time = asf->hdr.preroll;
asf_st->stream_language_index = 128; // invalid stream index means no language info
@@ -959,7 +960,7 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk
/* new packet */
av_new_packet(&asf_st->pkt, asf->packet_obj_size);
asf_st->seq = asf->packet_seq;
- asf_st->pkt.dts = asf->packet_frag_timestamp;
+ asf_st->pkt.dts = asf->packet_frag_timestamp - asf->hdr.preroll;
asf_st->pkt.stream_index = asf->stream_index;
asf_st->pkt.pos =
asf_st->packet_pos= asf->packet_pos;
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 7990ce7bbe..0471fd6c25 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -534,8 +534,6 @@ typedef struct AVStream {
* Only set this if you are absolutely 100% sure that the value you set
* it to really is the pts of the first frame.
* This may be undefined (AV_NOPTS_VALUE).
- * @note The ASF header does NOT contain a correct start_time the ASF
- * demuxer must NOT set this.
*/
int64_t start_time;
diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index 86701fa1aa..fafbae86e5 100644
--- a/libavformat/nutenc.c
+++ b/libavformat/nutenc.c
@@ -846,6 +846,7 @@ static int write_trailer(AVFormatContext *s){
avio_flush(bc);
ff_nut_free_sp(nut);
av_freep(&nut->stream);
+ av_freep(&nut->chapter);
av_freep(&nut->time_base);
return 0;
diff --git a/tests/ref/seek/lavf_asf b/tests/ref/seek/lavf_asf
index afaed99e77..757fd0e0bb 100644
--- a/tests/ref/seek/lavf_asf
+++ b/tests/ref/seek/lavf_asf
@@ -1,53 +1,47 @@
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 575 size: 28487
ret: 0 st:-1 flags:0 ts:-1.000000
-ret: 0 st: 1 flags:1 dts: 3.544000 pts: 3.544000 pos: 147775 size: 209
+ret: 0 st: 1 flags:1 dts: 0.444000 pts: 0.444000 pos: 147775 size: 209
ret: 0 st:-1 flags:1 ts: 1.894167
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st: 1 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size: 209
ret: 0 st: 0 flags:0 ts: 0.788000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st: 1 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size: 209
ret: 0 st: 0 flags:1 ts:-0.317000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
-ret: 0 st: 1 flags:0 ts: 2.577000
-ret: 0 st: 1 flags:1 dts: 3.100000 pts: 3.100000 pos: 29375 size: 208
-ret: 0 st: 1 flags:1 ts: 1.471000
-ret: 0 st: 1 flags:1 dts: 3.100000 pts: 3.100000 pos: 29375 size: 208
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 575 size: 28487
+ret:-1 st: 1 flags:0 ts: 2.577000
+ret:-1 st: 1 flags:1 ts: 1.471000
ret: 0 st:-1 flags:0 ts: 0.365002
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st: 1 flags:1 dts: 0.444000 pts: 0.444000 pos: 147775 size: 209
ret: 0 st:-1 flags:1 ts:-0.740831
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 575 size: 28487
ret: 0 st: 0 flags:0 ts: 2.153000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st: 1 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size: 209
ret: 0 st: 0 flags:1 ts: 1.048000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st: 1 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size: 209
ret: 0 st: 1 flags:0 ts:-0.058000
-ret: 0 st: 1 flags:1 dts: 3.100000 pts: 3.100000 pos: 29375 size: 208
-ret: 0 st: 1 flags:1 ts: 2.836000
-ret: 0 st: 1 flags:1 dts: 3.100000 pts: 3.100000 pos: 29375 size: 208
+ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 29375 size: 208
+ret:-1 st: 1 flags:1 ts: 2.836000
ret: 0 st:-1 flags:0 ts: 1.730004
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st: 1 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size: 209
ret: 0 st:-1 flags:1 ts: 0.624171
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st: 1 flags:1 dts: 0.444000 pts: 0.444000 pos: 147775 size: 209
ret: 0 st: 0 flags:0 ts:-0.482000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 575 size: 28487
ret: 0 st: 0 flags:1 ts: 2.413000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
-ret: 0 st: 1 flags:0 ts: 1.307000
-ret: 0 st: 1 flags:1 dts: 3.100000 pts: 3.100000 pos: 29375 size: 208
+ret: 0 st: 1 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size: 209
+ret:-1 st: 1 flags:0 ts: 1.307000
ret: 0 st: 1 flags:1 ts: 0.201000
-ret: 0 st: 1 flags:1 dts: 3.100000 pts: 3.100000 pos: 29375 size: 208
+ret: 0 st: 1 flags:1 dts: 0.183000 pts: 0.183000 pos: 70975 size: 209
ret: 0 st:-1 flags:0 ts:-0.904994
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 575 size: 28487
ret: 0 st:-1 flags:1 ts: 1.989173
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st: 1 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size: 209
ret: 0 st: 0 flags:0 ts: 0.883000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st: 1 flags:1 dts: 0.960000 pts: 0.960000 pos: -1 size: 209
ret: 0 st: 0 flags:1 ts:-0.222000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
-ret: 0 st: 1 flags:0 ts: 2.672000
-ret: 0 st: 1 flags:1 dts: 3.100000 pts: 3.100000 pos: 29375 size: 208
-ret: 0 st: 1 flags:1 ts: 1.566000
-ret: 0 st: 1 flags:1 dts: 3.100000 pts: 3.100000 pos: 29375 size: 208
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 575 size: 28487
+ret:-1 st: 1 flags:0 ts: 2.672000
+ret:-1 st: 1 flags:1 ts: 1.566000
ret: 0 st:-1 flags:0 ts: 0.460008
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st: 1 flags:1 dts: 0.444000 pts: 0.444000 pos: 147775 size: 209
ret: 0 st:-1 flags:1 ts:-0.645825
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 575 size: 28487
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 575 size: 28487
diff --git a/tests/ref/seek/wmav1_asf b/tests/ref/seek/wmav1_asf
index a2892b6344..47c5b46621 100644
--- a/tests/ref/seek/wmav1_asf
+++ b/tests/ref/seek/wmav1_asf
@@ -1,53 +1,53 @@
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 404 size: 743
ret: 0 st:-1 flags:0 ts:-1.000000
-ret: 0 st: 0 flags:1 dts: 3.286000 pts: 3.286000 pos: 3604 size: 743
+ret: 0 st: 0 flags:1 dts: 0.186000 pts: 0.186000 pos: 3604 size: 743
ret: 0 st:-1 flags:1 ts: 1.894167
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 dts: 1.858000 pts: 1.858000 pos: 32404 size: 743
ret: 0 st: 0 flags:0 ts: 0.788000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 dts: 0.929000 pts: 0.929000 pos: 16404 size: 743
ret: 0 st: 0 flags:1 ts:-0.317000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 404 size: 743
ret: 0 st:-1 flags:0 ts: 2.576668
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 dts: 2.601000 pts: 2.601000 pos: 45204 size: 743
ret: 0 st:-1 flags:1 ts: 1.470835
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 dts: 1.300000 pts: 1.300000 pos: 22804 size: 743
ret: 0 st: 0 flags:0 ts: 0.365000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 dts: 0.372000 pts: 0.372000 pos: 6804 size: 743
ret: 0 st: 0 flags:1 ts:-0.741000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 404 size: 743
ret: 0 st:-1 flags:0 ts: 2.153336
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 dts: 2.229000 pts: 2.229000 pos: 38804 size: 743
ret: 0 st:-1 flags:1 ts: 1.047503
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 dts: 0.929000 pts: 0.929000 pos: 16404 size: 743
ret: 0 st: 0 flags:0 ts:-0.058000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 404 size: 743
ret: 0 st: 0 flags:1 ts: 2.836000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 dts: 2.786000 pts: 2.786000 pos: 48404 size: 743
ret: 0 st:-1 flags:0 ts: 1.730004
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 dts: 1.858000 pts: 1.858000 pos: 32404 size: 743
ret: 0 st:-1 flags:1 ts: 0.624171
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 dts: 0.557000 pts: 0.557000 pos: 10004 size: 743
ret: 0 st: 0 flags:0 ts:-0.482000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 404 size: 743
ret: 0 st: 0 flags:1 ts: 2.413000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 dts: 2.229000 pts: 2.229000 pos: 38804 size: 743
ret: 0 st:-1 flags:0 ts: 1.306672
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 dts: 1.486000 pts: 1.486000 pos: 26004 size: 743
ret: 0 st:-1 flags:1 ts: 0.200839
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 dts: 0.186000 pts: 0.186000 pos: 3604 size: 743
ret: 0 st: 0 flags:0 ts:-0.905000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 404 size: 743
ret: 0 st: 0 flags:1 ts: 1.989000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 dts: 1.858000 pts: 1.858000 pos: 32404 size: 743
ret: 0 st:-1 flags:0 ts: 0.883340
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 dts: 0.929000 pts: 0.929000 pos: 16404 size: 743
ret: 0 st:-1 flags:1 ts:-0.222493
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 404 size: 743
ret: 0 st: 0 flags:0 ts: 2.672000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 dts: 2.786000 pts: 2.786000 pos: 48404 size: 743
ret: 0 st: 0 flags:1 ts: 1.566000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 dts: 1.486000 pts: 1.486000 pos: 26004 size: 743
ret: 0 st:-1 flags:0 ts: 0.460008
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 dts: 0.557000 pts: 0.557000 pos: 10004 size: 743
ret: 0 st:-1 flags:1 ts:-0.645825
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 404 size: 743
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 404 size: 743
diff --git a/tests/ref/seek/wmav2_asf b/tests/ref/seek/wmav2_asf
index bd1b79e48b..7c58da2320 100644
--- a/tests/ref/seek/wmav2_asf
+++ b/tests/ref/seek/wmav2_asf
@@ -1,53 +1,53 @@
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 444 size: 743
ret: 0 st:-1 flags:0 ts:-1.000000
-ret: 0 st: 0 flags:1 dts: 3.286000 pts: 3.286000 pos: 3644 size: 743
+ret: 0 st: 0 flags:1 dts: 0.186000 pts: 0.186000 pos: 3644 size: 743
ret: 0 st:-1 flags:1 ts: 1.894167
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 dts: 1.858000 pts: 1.858000 pos: 32444 size: 743
ret: 0 st: 0 flags:0 ts: 0.788000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 dts: 0.929000 pts: 0.929000 pos: 16444 size: 743
ret: 0 st: 0 flags:1 ts:-0.317000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 444 size: 743
ret: 0 st:-1 flags:0 ts: 2.576668
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 dts: 2.601000 pts: 2.601000 pos: 45244 size: 743
ret: 0 st:-1 flags:1 ts: 1.470835
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 dts: 1.300000 pts: 1.300000 pos: 22844 size: 743
ret: 0 st: 0 flags:0 ts: 0.365000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 dts: 0.372000 pts: 0.372000 pos: 6844 size: 743
ret: 0 st: 0 flags:1 ts:-0.741000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 444 size: 743
ret: 0 st:-1 flags:0 ts: 2.153336
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 dts: 2.229000 pts: 2.229000 pos: 38844 size: 743
ret: 0 st:-1 flags:1 ts: 1.047503
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 dts: 0.929000 pts: 0.929000 pos: 16444 size: 743
ret: 0 st: 0 flags:0 ts:-0.058000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 444 size: 743
ret: 0 st: 0 flags:1 ts: 2.836000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 dts: 2.786000 pts: 2.786000 pos: 48444 size: 743
ret: 0 st:-1 flags:0 ts: 1.730004
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 dts: 1.858000 pts: 1.858000 pos: 32444 size: 743
ret: 0 st:-1 flags:1 ts: 0.624171
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 dts: 0.557000 pts: 0.557000 pos: 10044 size: 743
ret: 0 st: 0 flags:0 ts:-0.482000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 444 size: 743
ret: 0 st: 0 flags:1 ts: 2.413000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 dts: 2.229000 pts: 2.229000 pos: 38844 size: 743
ret: 0 st:-1 flags:0 ts: 1.306672
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 dts: 1.486000 pts: 1.486000 pos: 26044 size: 743
ret: 0 st:-1 flags:1 ts: 0.200839
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 dts: 0.186000 pts: 0.186000 pos: 3644 size: 743
ret: 0 st: 0 flags:0 ts:-0.905000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 444 size: 743
ret: 0 st: 0 flags:1 ts: 1.989000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 dts: 1.858000 pts: 1.858000 pos: 32444 size: 743
ret: 0 st:-1 flags:0 ts: 0.883340
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 dts: 0.929000 pts: 0.929000 pos: 16444 size: 743
ret: 0 st:-1 flags:1 ts:-0.222493
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 444 size: 743
ret: 0 st: 0 flags:0 ts: 2.672000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 dts: 2.786000 pts: 2.786000 pos: 48444 size: 743
ret: 0 st: 0 flags:1 ts: 1.566000
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 dts: 1.486000 pts: 1.486000 pos: 26044 size: 743
ret: 0 st:-1 flags:0 ts: 0.460008
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 dts: 0.557000 pts: 0.557000 pos: 10044 size: 743
ret: 0 st:-1 flags:1 ts:-0.645825
-ret: 0 st: 0 flags:1 dts: 3.100000 pts: 3.100000 pos: 444 size: 743
+ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 444 size: 743