[FFmpeg-devel] [PATCH 1/4] avformat/utils: return EINVAL from seek_frame_generic() when the requested target appears to be outside the file duration

Michael Niedermayer michaelni at gmx.at
Thu Sep 11 16:48:00 CEST 2014


Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavformat/utils.c                      |    4 +--
 tests/ref/seek/acodec-adpcm-swf          |    8 ++---
 tests/ref/seek/acodec-adpcm-swf-trellis  |    8 ++---
 tests/ref/seek/acodec-mp2                |    8 ++---
 tests/ref/seek/lavf-avi                  |   18 +++++------
 tests/ref/seek/lavf-flv_fmt              |   18 +++++------
 tests/ref/seek/lavf-gif                  |   26 +++++++--------
 tests/ref/seek/lavf-mkv                  |   10 +++---
 tests/ref/seek/lavf-mmf                  |   18 +++++------
 tests/ref/seek/lavf-mov                  |   10 +++---
 tests/ref/seek/lavf-mxf                  |   10 +++---
 tests/ref/seek/lavf-swf                  |   52 +++++++++++++++---------------
 tests/ref/seek/lavf-voc                  |   52 +++++++++++++++---------------
 tests/ref/seek/lavf-wtv                  |   10 +++---
 tests/ref/seek/lavf-yuv4mpeg             |   52 +++++++++++++++---------------
 tests/ref/seek/vsynth2-asv1              |   14 ++++----
 tests/ref/seek/vsynth2-asv2              |   14 ++++----
 tests/ref/seek/vsynth2-dnxhd-1080i       |   18 +++++------
 tests/ref/seek/vsynth2-dnxhd-720p        |   26 +++++++--------
 tests/ref/seek/vsynth2-dnxhd-720p-rd     |   26 +++++++--------
 tests/ref/seek/vsynth2-ffv1              |   14 ++++----
 tests/ref/seek/vsynth2-flashsv           |   14 ++++----
 tests/ref/seek/vsynth2-flv               |   14 ++++----
 tests/ref/seek/vsynth2-h261              |   14 ++++----
 tests/ref/seek/vsynth2-h263              |   14 ++++----
 tests/ref/seek/vsynth2-h263p             |   14 ++++----
 tests/ref/seek/vsynth2-huffyuv           |   14 ++++----
 tests/ref/seek/vsynth2-jpegls            |   14 ++++----
 tests/ref/seek/vsynth2-ljpeg             |   14 ++++----
 tests/ref/seek/vsynth2-mjpeg             |   14 ++++----
 tests/ref/seek/vsynth2-mpeg1             |   14 ++++----
 tests/ref/seek/vsynth2-mpeg1b            |   14 ++++----
 tests/ref/seek/vsynth2-mpeg2-422         |   14 ++++----
 tests/ref/seek/vsynth2-mpeg2-idct-int    |   14 ++++----
 tests/ref/seek/vsynth2-mpeg2-ilace       |   14 ++++----
 tests/ref/seek/vsynth2-mpeg2-ivlc-qprd   |   14 ++++----
 tests/ref/seek/vsynth2-mpeg2-thread      |   14 ++++----
 tests/ref/seek/vsynth2-mpeg2-thread-ivlc |   14 ++++----
 tests/ref/seek/vsynth2-mpeg4             |    6 ++--
 tests/ref/seek/vsynth2-mpeg4-adap        |   14 ++++----
 tests/ref/seek/vsynth2-mpeg4-adv         |   14 ++++----
 tests/ref/seek/vsynth2-mpeg4-error       |   14 ++++----
 tests/ref/seek/vsynth2-mpeg4-nr          |   14 ++++----
 tests/ref/seek/vsynth2-mpeg4-nsse        |   14 ++++----
 tests/ref/seek/vsynth2-mpeg4-qpel        |   14 ++++----
 tests/ref/seek/vsynth2-mpeg4-qprd        |   14 ++++----
 tests/ref/seek/vsynth2-mpeg4-rc          |   14 ++++----
 tests/ref/seek/vsynth2-mpeg4-thread      |   14 ++++----
 tests/ref/seek/vsynth2-msmpeg4           |   14 ++++----
 tests/ref/seek/vsynth2-msmpeg4v2         |   14 ++++----
 tests/ref/seek/vsynth2-rgb               |   14 ++++----
 tests/ref/seek/vsynth2-roqvideo          |   52 +++++++++++++++---------------
 tests/ref/seek/vsynth2-snow              |   14 ++++----
 tests/ref/seek/vsynth2-snow-ll           |   14 ++++----
 tests/ref/seek/vsynth2-svq1              |    6 ++--
 tests/ref/seek/vsynth2-wmv1              |   14 ++++----
 tests/ref/seek/vsynth2-wmv2              |   14 ++++----
 tests/ref/seek/vsynth2-yuv               |   14 ++++----
 58 files changed, 478 insertions(+), 478 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index d6e3e50..f79567e 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1970,7 +1970,7 @@ static int seek_frame_generic(AVFormatContext *s, int stream_index,
 
     if (index < 0 && st->nb_index_entries &&
         timestamp < st->index_entries[0].timestamp)
-        return -1;
+        return AVERROR(EINVAL);
 
     if (index < 0 || index == st->nb_index_entries - 1) {
         AVPacket pkt;
@@ -2006,7 +2006,7 @@ static int seek_frame_generic(AVFormatContext *s, int stream_index,
         index = av_index_search_timestamp(st, timestamp, flags);
     }
     if (index < 0)
-        return -1;
+        return AVERROR(EINVAL);
 
     ff_read_frame_flush(s);
     if (s->iformat->read_seek)
diff --git a/tests/ref/seek/acodec-adpcm-swf b/tests/ref/seek/acodec-adpcm-swf
index 2f90913..bd86bc4 100644
--- a/tests/ref/seek/acodec-adpcm-swf
+++ b/tests/ref/seek/acodec-adpcm-swf
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.858000 pts: 1.858000 pos:  82968 size:  2053
 ret: 0         st: 0 flags:0  ts: 0.788000
 ret: 0         st: 0 flags:1 dts: 0.789000 pts: 0.789000 pos:  35381 size:  2053
-ret:-1         st: 0 flags:1  ts:-0.317000
+ret:-EINVAL    st: 0 flags:1  ts:-0.317000
 ret: 0         st:-1 flags:0  ts: 2.576668
 ret: 0         st: 0 flags:1 dts: 2.601000 pts: 2.601000 pos: 116072 size:  2053
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  64347 size:  2053
 ret: 0         st: 0 flags:0  ts: 0.365000
 ret: 0         st: 0 flags:1 dts: 0.372000 pts: 0.372000 pos:  16760 size:  2053
-ret:-1         st: 0 flags:1  ts:-0.741000
+ret:-EINVAL    st: 0 flags:1  ts:-0.741000
 ret: 0         st:-1 flags:0  ts: 2.153336
 ret: 0         st: 0 flags:1 dts: 2.183000 pts: 2.183000 pos:  97451 size:  2053
 ret: 0         st:-1 flags:1  ts: 1.047503
@@ -39,11 +39,11 @@ ret: 0         st: 0 flags:1  ts: 1.989000
 ret: 0         st: 0 flags:1 dts: 1.950000 pts: 1.950000 pos:  87106 size:  2053
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.929000 pts: 0.929000 pos:  41588 size:  2053
-ret:-1         st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
 ret: 0         st: 0 flags:0  ts: 2.672000
 ret: 0         st: 0 flags:1 dts: 2.694000 pts: 2.694000 pos: 120210 size:  2053
 ret: 0         st: 0 flags:1  ts: 1.566000
 ret: 0         st: 0 flags:1 dts: 1.533000 pts: 1.533000 pos:  68485 size:  2053
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.464000 pts: 0.464000 pos:  20898 size:  2053
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/acodec-adpcm-swf-trellis b/tests/ref/seek/acodec-adpcm-swf-trellis
index 2f90913..bd86bc4 100644
--- a/tests/ref/seek/acodec-adpcm-swf-trellis
+++ b/tests/ref/seek/acodec-adpcm-swf-trellis
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.858000 pts: 1.858000 pos:  82968 size:  2053
 ret: 0         st: 0 flags:0  ts: 0.788000
 ret: 0         st: 0 flags:1 dts: 0.789000 pts: 0.789000 pos:  35381 size:  2053
-ret:-1         st: 0 flags:1  ts:-0.317000
+ret:-EINVAL    st: 0 flags:1  ts:-0.317000
 ret: 0         st:-1 flags:0  ts: 2.576668
 ret: 0         st: 0 flags:1 dts: 2.601000 pts: 2.601000 pos: 116072 size:  2053
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  64347 size:  2053
 ret: 0         st: 0 flags:0  ts: 0.365000
 ret: 0         st: 0 flags:1 dts: 0.372000 pts: 0.372000 pos:  16760 size:  2053
-ret:-1         st: 0 flags:1  ts:-0.741000
+ret:-EINVAL    st: 0 flags:1  ts:-0.741000
 ret: 0         st:-1 flags:0  ts: 2.153336
 ret: 0         st: 0 flags:1 dts: 2.183000 pts: 2.183000 pos:  97451 size:  2053
 ret: 0         st:-1 flags:1  ts: 1.047503
@@ -39,11 +39,11 @@ ret: 0         st: 0 flags:1  ts: 1.989000
 ret: 0         st: 0 flags:1 dts: 1.950000 pts: 1.950000 pos:  87106 size:  2053
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.929000 pts: 0.929000 pos:  41588 size:  2053
-ret:-1         st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
 ret: 0         st: 0 flags:0  ts: 2.672000
 ret: 0         st: 0 flags:1 dts: 2.694000 pts: 2.694000 pos: 120210 size:  2053
 ret: 0         st: 0 flags:1  ts: 1.566000
 ret: 0         st: 0 flags:1 dts: 1.533000 pts: 1.533000 pos:  68485 size:  2053
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.464000 pts: 0.464000 pos:  20898 size:  2053
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/acodec-mp2 b/tests/ref/seek/acodec-mp2
index 62abab4..a2d2d7a 100644
--- a/tests/ref/seek/acodec-mp2
+++ b/tests/ref/seek/acodec-mp2
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.880816 pts: 1.880816 pos:  30093 size:   418
 ret: 0         st: 0 flags:0  ts: 0.788334
 ret: 0         st: 0 flags:1 dts: 0.809796 pts: 0.809796 pos:  12956 size:   418
-ret:-1         st: 0 flags:1  ts:-0.317499
+ret:-EINVAL    st: 0 flags:1  ts:-0.317499
 ret: 0         st:-1 flags:0  ts: 2.576668
 ret: 0         st: 0 flags:1 dts: 2.586122 pts: 2.586122 pos:  41377 size:   418
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.462857 pts: 1.462857 pos:  23405 size:   418
 ret: 0         st: 0 flags:0  ts: 0.365002
 ret: 0         st: 0 flags:1 dts: 0.365714 pts: 0.365714 pos:   5851 size:   418
-ret:-1         st: 0 flags:1  ts:-0.740831
+ret:-EINVAL    st: 0 flags:1  ts:-0.740831
 ret: 0         st:-1 flags:0  ts: 2.153336
 ret: 0         st: 0 flags:1 dts: 2.168163 pts: 2.168163 pos:  34690 size:   418
 ret: 0         st:-1 flags:1  ts: 1.047503
@@ -39,11 +39,11 @@ ret: 0         st: 0 flags:1  ts: 1.989173
 ret: 0         st: 0 flags:1 dts: 1.985306 pts: 1.985306 pos:  31764 size:   418
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.888163 pts: 0.888163 pos:  14210 size:   418
-ret:-1         st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
 ret: 0         st: 0 flags:0  ts: 2.671674
 ret: 0         st: 0 flags:1 dts: 2.690612 pts: 2.690612 pos:  43049 size:   418
 ret: 0         st: 0 flags:1  ts: 1.565841
 ret: 0         st: 0 flags:1 dts: 1.541224 pts: 1.541224 pos:  24659 size:   418
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.470204 pts: 0.470204 pos:   7523 size:   418
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/lavf-avi b/tests/ref/seek/lavf-avi
index 7725134..5acd4ae 100644
--- a/tests/ref/seek/lavf-avi
+++ b/tests/ref/seek/lavf-avi
@@ -5,28 +5,28 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 301474 size: 27864
 ret: 0         st: 0 flags:0  ts: 0.800000
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 301474 size: 27864
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st: 1 flags:0  ts: 2.586122
+ret:-EINVAL    st: 0 flags:1  ts:-0.320000
+ret:-EINVAL    st: 1 flags:0  ts: 2.586122
 ret: 0         st: 1 flags:1  ts: 1.462857
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 301474 size: 27864
 ret: 0         st:-1 flags:0  ts: 0.365002
 ret: 0         st: 1 flags:1 dts: 0.470204 pts: 0.470204 pos: 155956 size:   209
-ret:-1         st:-1 flags:1  ts:-0.740831
-ret:-1         st: 0 flags:0  ts: 2.160000
+ret:-EINVAL    st:-1 flags:1  ts:-0.740831
+ret:-EINVAL    st: 0 flags:0  ts: 2.160000
 ret: 0         st: 0 flags:1  ts: 1.040000
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 301474 size: 27864
 ret: 0         st: 1 flags:0  ts:-0.052245
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   9926 size: 27867
 ret: 0         st: 1 flags:1  ts: 2.847347
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 301474 size: 27864
-ret:-1         st:-1 flags:0  ts: 1.730004
+ret:-EINVAL    st:-1 flags:0  ts: 1.730004
 ret: 0         st:-1 flags:1  ts: 0.624171
 ret: 0         st: 1 flags:1 dts: 0.470204 pts: 0.470204 pos: 155956 size:   209
 ret: 0         st: 0 flags:0  ts:-0.480000
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   9926 size: 27867
 ret: 0         st: 0 flags:1  ts: 2.400000
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 301474 size: 27864
-ret:-1         st: 1 flags:0  ts: 1.306122
+ret:-EINVAL    st: 1 flags:0  ts: 1.306122
 ret: 0         st: 1 flags:1  ts: 0.208980
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   9926 size: 27867
 ret: 0         st:-1 flags:0  ts:-0.904994
@@ -35,10 +35,10 @@ ret: 0         st:-1 flags:1  ts: 1.989173
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 301474 size: 27864
 ret: 0         st: 0 flags:0  ts: 0.880000
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 301474 size: 27864
-ret:-1         st: 0 flags:1  ts:-0.240000
-ret:-1         st: 1 flags:0  ts: 2.664490
+ret:-EINVAL    st: 0 flags:1  ts:-0.240000
+ret:-EINVAL    st: 1 flags:0  ts: 2.664490
 ret: 0         st: 1 flags:1  ts: 1.567347
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 301474 size: 27864
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 1 flags:1 dts: 0.470204 pts: 0.470204 pos: 155956 size:   209
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/lavf-flv_fmt b/tests/ref/seek/lavf-flv_fmt
index c12da84..0424fb6 100644
--- a/tests/ref/seek/lavf-flv_fmt
+++ b/tests/ref/seek/lavf-flv_fmt
@@ -5,28 +5,28 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298416 size: 31134
 ret: 0         st: 0 flags:0  ts: 0.788000
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298416 size: 31134
-ret:-1         st: 0 flags:1  ts:-0.317000
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.317000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298416 size: 31134
 ret: 0         st: 0 flags:0  ts: 0.365000
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 149456 size: 31125
-ret:-1         st: 0 flags:1  ts:-0.741000
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.741000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298416 size: 31134
 ret: 0         st: 0 flags:0  ts:-0.058000
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    217 size: 31074
 ret: 0         st: 0 flags:1  ts: 2.836000
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298416 size: 31134
-ret:-1         st:-1 flags:0  ts: 1.730004
+ret:-EINVAL    st:-1 flags:0  ts: 1.730004
 ret: 0         st:-1 flags:1  ts: 0.624171
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 149456 size: 31125
 ret: 0         st: 0 flags:0  ts:-0.482000
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    217 size: 31074
 ret: 0         st: 0 flags:1  ts: 2.413000
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298416 size: 31134
-ret:-1         st:-1 flags:0  ts: 1.306672
+ret:-EINVAL    st:-1 flags:0  ts: 1.306672
 ret: 0         st:-1 flags:1  ts: 0.200839
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    217 size: 31074
 ret: 0         st: 0 flags:0  ts:-0.905000
@@ -35,10 +35,10 @@ ret: 0         st: 0 flags:1  ts: 1.989000
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298416 size: 31134
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298416 size: 31134
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.672000
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.672000
 ret: 0         st: 0 flags:1  ts: 1.566000
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298416 size: 31134
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 149456 size: 31125
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/lavf-gif b/tests/ref/seek/lavf-gif
index 9ce8308..2273187 100644
--- a/tests/ref/seek/lavf-gif
+++ b/tests/ref/seek/lavf-gif
@@ -3,38 +3,38 @@ ret: 0         st:-1 flags:0  ts:-1.000000
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size: 81501
 ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size: 81501
-ret:-1         st: 0 flags:0  ts: 0.790000
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:0  ts: 0.790000
+ret:-EINVAL    st: 0 flags:1  ts:-0.320000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size: 81501
-ret:-1         st: 0 flags:0  ts: 0.370000
-ret:-1         st: 0 flags:1  ts:-0.740000
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:0  ts: 0.370000
+ret:-EINVAL    st: 0 flags:1  ts:-0.740000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size: 81501
 ret: 0         st: 0 flags:0  ts:-0.060000
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size: 81501
 ret: 0         st: 0 flags:1  ts: 2.840000
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size: 81501
-ret:-1         st:-1 flags:0  ts: 1.730004
+ret:-EINVAL    st:-1 flags:0  ts: 1.730004
 ret: 0         st:-1 flags:1  ts: 0.624171
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size: 81501
 ret: 0         st: 0 flags:0  ts:-0.480000
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size: 81501
 ret: 0         st: 0 flags:1  ts: 2.410000
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size: 81501
-ret:-1         st:-1 flags:0  ts: 1.306672
+ret:-EINVAL    st:-1 flags:0  ts: 1.306672
 ret: 0         st:-1 flags:1  ts: 0.200839
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size: 81501
 ret: 0         st: 0 flags:0  ts:-0.900000
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size: 81501
 ret: 0         st: 0 flags:1  ts: 1.990000
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size: 81501
-ret:-1         st:-1 flags:0  ts: 0.883340
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.670000
+ret:-EINVAL    st:-1 flags:0  ts: 0.883340
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.670000
 ret: 0         st: 0 flags:1  ts: 1.570000
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size: 81501
-ret:-1         st:-1 flags:0  ts: 0.460008
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:0  ts: 0.460008
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/lavf-mkv b/tests/ref/seek/lavf-mkv
index 11275d6..764cd5d 100644
--- a/tests/ref/seek/lavf-mkv
+++ b/tests/ref/seek/lavf-mkv
@@ -7,28 +7,28 @@ ret: 0         st: 0 flags:0  ts: 0.788000
 ret: 0         st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 292291 size: 27834
 ret: 0         st: 0 flags:1  ts:-0.317000
 ret: 0         st: 0 flags:1 dts: 0.011000 pts: 0.011000 pos:    877 size: 27837
-ret:-1         st: 1 flags:0  ts: 2.577000
+ret:-EINVAL    st: 1 flags:0  ts: 2.577000
 ret: 0         st: 1 flags:1  ts: 1.471000
 ret: 0         st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 320132 size:   209
 ret: 0         st:-1 flags:0  ts: 0.365002
 ret: 0         st: 0 flags:1 dts: 0.491000 pts: 0.491000 pos: 146844 size: 27925
 ret: 0         st:-1 flags:1  ts:-0.740831
 ret: 0         st: 0 flags:1 dts: 0.011000 pts: 0.011000 pos:    877 size: 27837
-ret:-1         st: 0 flags:0  ts: 2.153000
+ret:-EINVAL    st: 0 flags:0  ts: 2.153000
 ret: 0         st: 0 flags:1  ts: 1.048000
 ret: 0         st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 292291 size: 27834
 ret: 0         st: 1 flags:0  ts:-0.058000
 ret: 0         st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos:    661 size:   208
 ret: 0         st: 1 flags:1  ts: 2.836000
 ret: 0         st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 320132 size:   209
-ret:-1         st:-1 flags:0  ts: 1.730004
+ret:-EINVAL    st:-1 flags:0  ts: 1.730004
 ret: 0         st:-1 flags:1  ts: 0.624171
 ret: 0         st: 0 flags:1 dts: 0.491000 pts: 0.491000 pos: 146844 size: 27925
 ret: 0         st: 0 flags:0  ts:-0.482000
 ret: 0         st: 0 flags:1 dts: 0.011000 pts: 0.011000 pos:    877 size: 27837
 ret: 0         st: 0 flags:1  ts: 2.413000
 ret: 0         st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 292291 size: 27834
-ret:-1         st: 1 flags:0  ts: 1.307000
+ret:-EINVAL    st: 1 flags:0  ts: 1.307000
 ret: 0         st: 1 flags:1  ts: 0.201000
 ret: 0         st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos:    661 size:   208
 ret: 0         st:-1 flags:0  ts:-0.904994
@@ -39,7 +39,7 @@ ret: 0         st: 0 flags:0  ts: 0.883000
 ret: 0         st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 292291 size: 27834
 ret: 0         st: 0 flags:1  ts:-0.222000
 ret: 0         st: 0 flags:1 dts: 0.011000 pts: 0.011000 pos:    877 size: 27837
-ret:-1         st: 1 flags:0  ts: 2.672000
+ret:-EINVAL    st: 1 flags:0  ts: 2.672000
 ret: 0         st: 1 flags:1  ts: 1.566000
 ret: 0         st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 320132 size:   209
 ret: 0         st:-1 flags:0  ts: 0.460008
diff --git a/tests/ref/seek/lavf-mmf b/tests/ref/seek/lavf-mmf
index 0bc98fa..43cabe1 100644
--- a/tests/ref/seek/lavf-mmf
+++ b/tests/ref/seek/lavf-mmf
@@ -5,28 +5,28 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 0.928798 pts: 0.928798 pos:  20563 size:  2048
 ret: 0         st: 0 flags:0  ts: 0.788345
 ret: 0         st: 0 flags:1 dts: 0.928798 pts: 0.928798 pos:  20563 size:  2048
-ret:-1         st: 0 flags:1  ts:-0.317506
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.317506
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 0.928798 pts: 0.928798 pos:  20563 size:  2048
 ret: 0         st: 0 flags:0  ts: 0.365011
 ret: 0         st: 0 flags:1 dts: 0.371519 pts: 0.371519 pos:   8275 size:  4096
-ret:-1         st: 0 flags:1  ts:-0.740839
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.740839
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.928798 pts: 0.928798 pos:  20563 size:  2048
 ret: 0         st: 0 flags:0  ts:-0.058322
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     83 size:  4096
 ret: 0         st: 0 flags:1  ts: 2.835828
 ret: 0         st: 0 flags:1 dts: 0.928798 pts: 0.928798 pos:  20563 size:  2048
-ret:-1         st:-1 flags:0  ts: 1.730004
+ret:-EINVAL    st:-1 flags:0  ts: 1.730004
 ret: 0         st:-1 flags:1  ts: 0.624171
 ret: 0         st: 0 flags:1 dts: 0.557279 pts: 0.557279 pos:  12371 size:  4096
 ret: 0         st: 0 flags:0  ts:-0.481655
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     83 size:  4096
 ret: 0         st: 0 flags:1  ts: 2.412494
 ret: 0         st: 0 flags:1 dts: 0.928798 pts: 0.928798 pos:  20563 size:  2048
-ret:-1         st:-1 flags:0  ts: 1.306672
+ret:-EINVAL    st:-1 flags:0  ts: 1.306672
 ret: 0         st:-1 flags:1  ts: 0.200839
 ret: 0         st: 0 flags:1 dts: 0.185760 pts: 0.185760 pos:   4179 size:  4096
 ret: 0         st: 0 flags:0  ts:-0.904989
@@ -35,10 +35,10 @@ ret: 0         st: 0 flags:1  ts: 1.989184
 ret: 0         st: 0 flags:1 dts: 0.928798 pts: 0.928798 pos:  20563 size:  2048
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.928798 pts: 0.928798 pos:  20563 size:  2048
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.671678
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.671678
 ret: 0         st: 0 flags:1  ts: 1.565850
 ret: 0         st: 0 flags:1 dts: 0.928798 pts: 0.928798 pos:  20563 size:  2048
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.557279 pts: 0.557279 pos:  12371 size:  4096
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/lavf-mov b/tests/ref/seek/lavf-mov
index 27ea7c7..e35d252 100644
--- a/tests/ref/seek/lavf-mov
+++ b/tests/ref/seek/lavf-mov
@@ -7,28 +7,28 @@ ret: 0         st: 0 flags:0  ts: 0.788359
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 327995 size: 27834
 ret: 0         st: 0 flags:1  ts:-0.317500
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   1767 size: 27837
-ret:-1         st: 1 flags:0  ts: 2.576667
+ret:-EINVAL    st: 1 flags:0  ts: 2.576667
 ret: 0         st: 1 flags:1  ts: 1.470839
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 327995 size: 27834
 ret: 0         st:-1 flags:0  ts: 0.365002
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 165249 size: 27925
 ret: 0         st:-1 flags:1  ts:-0.740831
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   1767 size: 27837
-ret:-1         st: 0 flags:0  ts: 2.153359
+ret:-EINVAL    st: 0 flags:0  ts: 2.153359
 ret: 0         st: 0 flags:1  ts: 1.047500
 ret: 0         st: 1 flags:1 dts: 0.952018 pts: 0.952018 pos: 326971 size:  1024
 ret: 0         st: 1 flags:0  ts:-0.058322
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   1767 size: 27837
 ret: 0         st: 1 flags:1  ts: 2.835828
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 327995 size: 27834
-ret:-1         st:-1 flags:0  ts: 1.730004
+ret:-EINVAL    st:-1 flags:0  ts: 1.730004
 ret: 0         st:-1 flags:1  ts: 0.624171
 ret: 0         st: 1 flags:1 dts: 0.464399 pts: 0.464399 pos: 164225 size:  1024
 ret: 0         st: 0 flags:0  ts:-0.481641
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   1767 size: 27837
 ret: 0         st: 0 flags:1  ts: 2.412500
 ret: 0         st: 1 flags:1 dts: 0.952018 pts: 0.952018 pos: 326971 size:  1024
-ret:-1         st: 1 flags:0  ts: 1.306667
+ret:-EINVAL    st: 1 flags:0  ts: 1.306667
 ret: 0         st: 1 flags:1  ts: 0.200839
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   1767 size: 27837
 ret: 0         st:-1 flags:0  ts:-0.904994
@@ -39,7 +39,7 @@ ret: 0         st: 0 flags:0  ts: 0.883359
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 327995 size: 27834
 ret: 0         st: 0 flags:1  ts:-0.222500
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   1767 size: 27837
-ret:-1         st: 1 flags:0  ts: 2.671678
+ret:-EINVAL    st: 1 flags:0  ts: 2.671678
 ret: 0         st: 1 flags:1  ts: 1.565850
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 327995 size: 27834
 ret: 0         st:-1 flags:0  ts: 0.460008
diff --git a/tests/ref/seek/lavf-mxf b/tests/ref/seek/lavf-mxf
index 9b23466..66681b9 100644
--- a/tests/ref/seek/lavf-mxf
+++ b/tests/ref/seek/lavf-mxf
@@ -7,28 +7,28 @@ 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.576667
+ret:-EINVAL    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
 ret: 0         st:-1 flags:1  ts:-0.740831
 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:-EINVAL    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.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.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:-EINVAL    st:-1 flags:0  ts: 1.730004
 ret: 0         st:-1 flags:1  ts: 0.624171
 ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.480000 pos: 211456 size: 24786
 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.306667
+ret:-EINVAL    st: 1 flags:0  ts: 1.306667
 ret: 0         st: 1 flags:1  ts: 0.200833
 ret: 0         st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos:   6144 size: 24801
 ret: 0         st:-1 flags:0  ts:-0.904994
@@ -39,7 +39,7 @@ 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.671667
+ret:-EINVAL    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
diff --git a/tests/ref/seek/lavf-swf b/tests/ref/seek/lavf-swf
index 52cd1e2..00a9e32 100644
--- a/tests/ref/seek/lavf-swf
+++ b/tests/ref/seek/lavf-swf
@@ -1,27 +1,27 @@
 ret: 0         st: 0 flags:0 dts: 0.000000 pts: 0.000000 pos:     55 size: 31074
-ret:-1         st:-1 flags:0  ts:-1.000000
-ret:-1         st:-1 flags:1  ts: 1.894167
-ret:-1         st: 0 flags:0  ts: 0.800000
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret:-1         st:-1 flags:1  ts: 1.470835
-ret:-1         st: 0 flags:0  ts: 0.360000
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret:-1         st:-1 flags:1  ts: 1.047503
-ret:-1         st: 0 flags:0  ts:-0.040000
-ret:-1         st: 0 flags:1  ts: 2.840000
-ret:-1         st:-1 flags:0  ts: 1.730004
-ret:-1         st:-1 flags:1  ts: 0.624171
-ret:-1         st: 0 flags:0  ts:-0.480000
-ret:-1         st: 0 flags:1  ts: 2.400000
-ret:-1         st:-1 flags:0  ts: 1.306672
-ret:-1         st:-1 flags:1  ts: 0.200839
-ret:-1         st: 0 flags:0  ts:-0.920000
-ret:-1         st: 0 flags:1  ts: 2.000000
-ret:-1         st:-1 flags:0  ts: 0.883340
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret:-1         st: 0 flags:1  ts: 1.560000
-ret:-1         st:-1 flags:0  ts: 0.460008
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:0  ts:-1.000000
+ret:-EINVAL    st:-1 flags:1  ts: 1.894167
+ret:-EINVAL    st: 0 flags:0  ts: 0.800000
+ret:-EINVAL    st: 0 flags:1  ts:-0.320000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st:-1 flags:1  ts: 1.470835
+ret:-EINVAL    st: 0 flags:0  ts: 0.360000
+ret:-EINVAL    st: 0 flags:1  ts:-0.760000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st:-1 flags:1  ts: 1.047503
+ret:-EINVAL    st: 0 flags:0  ts:-0.040000
+ret:-EINVAL    st: 0 flags:1  ts: 2.840000
+ret:-EINVAL    st:-1 flags:0  ts: 1.730004
+ret:-EINVAL    st:-1 flags:1  ts: 0.624171
+ret:-EINVAL    st: 0 flags:0  ts:-0.480000
+ret:-EINVAL    st: 0 flags:1  ts: 2.400000
+ret:-EINVAL    st:-1 flags:0  ts: 1.306672
+ret:-EINVAL    st:-1 flags:1  ts: 0.200839
+ret:-EINVAL    st: 0 flags:0  ts:-0.920000
+ret:-EINVAL    st: 0 flags:1  ts: 2.000000
+ret:-EINVAL    st:-1 flags:0  ts: 0.883340
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.680000
+ret:-EINVAL    st: 0 flags:1  ts: 1.560000
+ret:-EINVAL    st:-1 flags:0  ts: 0.460008
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/lavf-voc b/tests/ref/seek/lavf-voc
index 833d763..ebb97f1 100644
--- a/tests/ref/seek/lavf-voc
+++ b/tests/ref/seek/lavf-voc
@@ -1,27 +1,27 @@
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     32 size:  1024
-ret:-1         st:-1 flags:0  ts:-1.000000
-ret:-1         st:-1 flags:1  ts: 1.894167
-ret:-1         st: 0 flags:0  ts: 0.788330
-ret:-1         st: 0 flags:1  ts:-0.317494
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret:-1         st:-1 flags:1  ts: 1.470835
-ret:-1         st: 0 flags:0  ts: 0.365012
-ret:-1         st: 0 flags:1  ts:-0.740834
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret:-1         st:-1 flags:1  ts: 1.047503
-ret:-1         st: 0 flags:0  ts:-0.058328
-ret:-1         st: 0 flags:1  ts: 2.835848
-ret:-1         st:-1 flags:0  ts: 1.730004
-ret:-1         st:-1 flags:1  ts: 0.624171
-ret:-1         st: 0 flags:0  ts:-0.481669
-ret:-1         st: 0 flags:1  ts: 2.412507
-ret:-1         st:-1 flags:0  ts: 1.306672
-ret:-1         st:-1 flags:1  ts: 0.200839
-ret:-1         st: 0 flags:0  ts:-0.904986
-ret:-1         st: 0 flags:1  ts: 1.989167
-ret:-1         st:-1 flags:0  ts: 0.883340
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.671673
-ret:-1         st: 0 flags:1  ts: 1.565849
-ret:-1         st:-1 flags:0  ts: 0.460008
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:0  ts:-1.000000
+ret:-EINVAL    st:-1 flags:1  ts: 1.894167
+ret:-EINVAL    st: 0 flags:0  ts: 0.788330
+ret:-EINVAL    st: 0 flags:1  ts:-0.317494
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st:-1 flags:1  ts: 1.470835
+ret:-EINVAL    st: 0 flags:0  ts: 0.365012
+ret:-EINVAL    st: 0 flags:1  ts:-0.740834
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st:-1 flags:1  ts: 1.047503
+ret:-EINVAL    st: 0 flags:0  ts:-0.058328
+ret:-EINVAL    st: 0 flags:1  ts: 2.835848
+ret:-EINVAL    st:-1 flags:0  ts: 1.730004
+ret:-EINVAL    st:-1 flags:1  ts: 0.624171
+ret:-EINVAL    st: 0 flags:0  ts:-0.481669
+ret:-EINVAL    st: 0 flags:1  ts: 2.412507
+ret:-EINVAL    st:-1 flags:0  ts: 1.306672
+ret:-EINVAL    st:-1 flags:1  ts: 0.200839
+ret:-EINVAL    st: 0 flags:0  ts:-0.904986
+ret:-EINVAL    st: 0 flags:1  ts: 1.989167
+ret:-EINVAL    st:-1 flags:0  ts: 0.883340
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.671673
+ret:-EINVAL    st: 0 flags:1  ts: 1.565849
+ret:-EINVAL    st:-1 flags:0  ts: 0.460008
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/lavf-wtv b/tests/ref/seek/lavf-wtv
index 355ab98..b254290 100644
--- a/tests/ref/seek/lavf-wtv
+++ b/tests/ref/seek/lavf-wtv
@@ -7,28 +7,28 @@ ret: 0         st: 0 flags:0  ts: 0.788334
 ret: 0         st: 1 flags:1 dts: 0.734399 pts: 0.734399 pos: 294672 size:   209
 ret: 0         st: 0 flags:1  ts:-0.317499
 ret: 0         st: 1 flags:1 dts: 0.029093 pts: 0.029093 pos:  26272 size:   208
-ret:-1         st: 1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 1 flags:0  ts: 2.576668
 ret: 0         st: 1 flags:1  ts: 1.470835
 ret: 0         st: 1 flags:1 dts: 0.734399 pts: 0.734399 pos: 294672 size:   209
 ret: 0         st:-1 flags:0  ts: 0.365002
 ret: 0         st: 1 flags:1 dts: 0.029093 pts: 0.029093 pos:  26272 size:   208
 ret: 0         st:-1 flags:1  ts:-0.740831
 ret: 0         st: 1 flags:1 dts: 0.029093 pts: 0.029093 pos:  26272 size:   208
-ret:-1         st: 0 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:0  ts: 2.153336
 ret: 0         st: 0 flags:1  ts: 1.047503
 ret: 0         st: 1 flags:1 dts: 0.029093 pts: 0.029093 pos:  26272 size:   208
 ret: 0         st: 1 flags:0  ts:-0.058330
 ret: 0         st: 1 flags:1 dts: 0.029093 pts: 0.029093 pos:  26272 size:   208
 ret: 0         st: 1 flags:1  ts: 2.835837
 ret: 0         st: 1 flags:1 dts: 0.734399 pts: 0.734399 pos: 294672 size:   209
-ret:-1         st:-1 flags:0  ts: 1.730004
+ret:-EINVAL    st:-1 flags:0  ts: 1.730004
 ret: 0         st:-1 flags:1  ts: 0.624171
 ret: 0         st: 1 flags:1 dts: 0.029093 pts: 0.029093 pos:  26272 size:   208
 ret: 0         st: 0 flags:0  ts:-0.481662
 ret: 0         st: 1 flags:1 dts: 0.029093 pts: 0.029093 pos:  26272 size:   208
 ret: 0         st: 0 flags:1  ts: 2.412505
 ret: 0         st: 1 flags:1 dts: 0.734399 pts: 0.734399 pos: 294672 size:   209
-ret:-1         st: 1 flags:0  ts: 1.306672
+ret:-EINVAL    st: 1 flags:0  ts: 1.306672
 ret: 0         st: 1 flags:1  ts: 0.200839
 ret: 0         st: 1 flags:1 dts: 0.211950 pts: 0.211950 pos:  99280 size:   209
 ret: 0         st:-1 flags:0  ts:-0.904994
@@ -39,7 +39,7 @@ ret: 0         st: 0 flags:0  ts: 0.883340
 ret: 0         st: 1 flags:1 dts: 0.734399 pts: 0.734399 pos: 294672 size:   209
 ret: 0         st: 0 flags:1  ts:-0.222493
 ret: 0         st: 1 flags:1 dts: 0.029093 pts: 0.029093 pos:  26272 size:   208
-ret:-1         st: 1 flags:0  ts: 2.671674
+ret:-EINVAL    st: 1 flags:0  ts: 2.671674
 ret: 0         st: 1 flags:1  ts: 1.565841
 ret: 0         st: 1 flags:1 dts: 0.734399 pts: 0.734399 pos: 294672 size:   209
 ret: 0         st:-1 flags:0  ts: 0.460008
diff --git a/tests/ref/seek/lavf-yuv4mpeg b/tests/ref/seek/lavf-yuv4mpeg
index 81c1de9..99de688 100644
--- a/tests/ref/seek/lavf-yuv4mpeg
+++ b/tests/ref/seek/lavf-yuv4mpeg
@@ -1,27 +1,27 @@
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     64 size:152064
-ret:-1         st:-1 flags:0  ts:-1.000000
-ret:-1         st:-1 flags:1  ts: 1.894167
-ret:-1         st: 0 flags:0  ts: 0.800000
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret:-1         st:-1 flags:1  ts: 1.470835
-ret:-1         st: 0 flags:0  ts: 0.360000
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret:-1         st:-1 flags:1  ts: 1.047503
-ret:-1         st: 0 flags:0  ts:-0.040000
-ret:-1         st: 0 flags:1  ts: 2.840000
-ret:-1         st:-1 flags:0  ts: 1.730004
-ret:-1         st:-1 flags:1  ts: 0.624171
-ret:-1         st: 0 flags:0  ts:-0.480000
-ret:-1         st: 0 flags:1  ts: 2.400000
-ret:-1         st:-1 flags:0  ts: 1.306672
-ret:-1         st:-1 flags:1  ts: 0.200839
-ret:-1         st: 0 flags:0  ts:-0.920000
-ret:-1         st: 0 flags:1  ts: 2.000000
-ret:-1         st:-1 flags:0  ts: 0.883340
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret:-1         st: 0 flags:1  ts: 1.560000
-ret:-1         st:-1 flags:0  ts: 0.460008
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:0  ts:-1.000000
+ret:-EINVAL    st:-1 flags:1  ts: 1.894167
+ret:-EINVAL    st: 0 flags:0  ts: 0.800000
+ret:-EINVAL    st: 0 flags:1  ts:-0.320000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st:-1 flags:1  ts: 1.470835
+ret:-EINVAL    st: 0 flags:0  ts: 0.360000
+ret:-EINVAL    st: 0 flags:1  ts:-0.760000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st:-1 flags:1  ts: 1.047503
+ret:-EINVAL    st: 0 flags:0  ts:-0.040000
+ret:-EINVAL    st: 0 flags:1  ts: 2.840000
+ret:-EINVAL    st:-1 flags:0  ts: 1.730004
+ret:-EINVAL    st:-1 flags:1  ts: 0.624171
+ret:-EINVAL    st: 0 flags:0  ts:-0.480000
+ret:-EINVAL    st: 0 flags:1  ts: 2.400000
+ret:-EINVAL    st:-1 flags:0  ts: 1.306672
+ret:-EINVAL    st:-1 flags:1  ts: 0.200839
+ret:-EINVAL    st: 0 flags:0  ts:-0.920000
+ret:-EINVAL    st: 0 flags:1  ts: 2.000000
+ret:-EINVAL    st:-1 flags:0  ts: 0.883340
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.680000
+ret:-EINVAL    st: 0 flags:1  ts: 1.560000
+ret:-EINVAL    st:-1 flags:0  ts: 0.460008
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-asv1 b/tests/ref/seek/vsynth2-asv1
index 5873bb1..a53a88a 100644
--- a/tests/ref/seek/vsynth2-asv1
+++ b/tests/ref/seek/vsynth2-asv1
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos: 776840 size: 18256
 ret: 0         st: 0 flags:0  ts: 0.800000
 ret: 0         st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos: 305352 size: 16180
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.320000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos: 595448 size: 17980
 ret: 0         st: 0 flags:0  ts: 0.360000
 ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos: 135516 size: 14868
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.760000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos: 404100 size: 16856
 ret: 0         st: 0 flags:0  ts:-0.040000
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 2.000000
 ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 813396 size: 18296
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos: 337808 size: 16388
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.680000
 ret: 0         st: 0 flags:1  ts: 1.560000
 ret: 0         st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos: 631584 size: 18188
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 180212 size: 15168
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-asv2 b/tests/ref/seek/vsynth2-asv2
index 7d37b7a..3c1ad4b 100644
--- a/tests/ref/seek/vsynth2-asv2
+++ b/tests/ref/seek/vsynth2-asv2
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos: 736152 size: 17340
 ret: 0         st: 0 flags:0  ts: 0.800000
 ret: 0         st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos: 289708 size: 15300
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.320000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos: 564140 size: 17016
 ret: 0         st: 0 flags:0  ts: 0.360000
 ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos: 128564 size: 14052
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.760000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos: 383244 size: 15896
 ret: 0         st: 0 flags:0  ts:-0.040000
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 2.000000
 ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 770852 size: 17400
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos: 320444 size: 15592
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.680000
 ret: 0         st: 0 flags:1  ts: 1.560000
 ret: 0         st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos: 598288 size: 17180
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 171012 size: 14392
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-dnxhd-1080i b/tests/ref/seek/vsynth2-dnxhd-1080i
index a5f0ce9..35bd2b3 100644
--- a/tests/ref/seek/vsynth2-dnxhd-1080i
+++ b/tests/ref/seek/vsynth2-dnxhd-1080i
@@ -3,42 +3,42 @@ ret: 0         st:-1 flags:0  ts:-1.000000
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:606208
 ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:2424868 size:606208
-ret:-1         st: 0 flags:0  ts: 0.788359
+ret:-EINVAL    st: 0 flags:0  ts: 0.788359
 ret: 0         st: 0 flags:1  ts:-0.317500
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:606208
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:2424868 size:606208
-ret:-1         st: 0 flags:0  ts: 0.365000
+ret:-EINVAL    st: 0 flags:0  ts: 0.365000
 ret: 0         st: 0 flags:1  ts:-0.740859
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:606208
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:2424868 size:606208
 ret: 0         st: 0 flags:0  ts:-0.058359
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:606208
 ret: 0         st: 0 flags:1  ts: 2.835859
 ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:2424868 size:606208
-ret:-1         st:-1 flags:0  ts: 1.730004
+ret:-EINVAL    st:-1 flags:0  ts: 1.730004
 ret: 0         st:-1 flags:1  ts: 0.624171
 ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:2424868 size:606208
 ret: 0         st: 0 flags:0  ts:-0.481641
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:606208
 ret: 0         st: 0 flags:1  ts: 2.412500
 ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:2424868 size:606208
-ret:-1         st:-1 flags:0  ts: 1.306672
+ret:-EINVAL    st:-1 flags:0  ts: 1.306672
 ret: 0         st:-1 flags:1  ts: 0.200839
 ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:2424868 size:606208
 ret: 0         st: 0 flags:0  ts:-0.905000
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:606208
 ret: 0         st: 0 flags:1  ts: 1.989141
 ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:2424868 size:606208
-ret:-1         st:-1 flags:0  ts: 0.883340
+ret:-EINVAL    st:-1 flags:0  ts: 0.883340
 ret: 0         st:-1 flags:1  ts:-0.222493
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:606208
-ret:-1         st: 0 flags:0  ts: 2.671641
+ret:-EINVAL    st: 0 flags:0  ts: 2.671641
 ret: 0         st: 0 flags:1  ts: 1.565859
 ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:2424868 size:606208
-ret:-1         st:-1 flags:0  ts: 0.460008
+ret:-EINVAL    st:-1 flags:0  ts: 0.460008
 ret: 0         st:-1 flags:1  ts:-0.645825
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:606208
diff --git a/tests/ref/seek/vsynth2-dnxhd-720p b/tests/ref/seek/vsynth2-dnxhd-720p
index b57f07d..b165d30 100644
--- a/tests/ref/seek/vsynth2-dnxhd-720p
+++ b/tests/ref/seek/vsynth2-dnxhd-720p
@@ -3,38 +3,38 @@ ret: 0         st:-1 flags:0  ts:-1.000000
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:458752
 ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
-ret:-1         st: 0 flags:0  ts: 0.788334
-ret:-1         st: 0 flags:1  ts:-0.317499
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:0  ts: 0.788334
+ret:-EINVAL    st: 0 flags:1  ts:-0.317499
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
-ret:-1         st: 0 flags:0  ts: 0.365002
-ret:-1         st: 0 flags:1  ts:-0.740831
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:0  ts: 0.365002
+ret:-EINVAL    st: 0 flags:1  ts:-0.740831
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
 ret: 0         st: 0 flags:0  ts:-0.058330
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:458752
 ret: 0         st: 0 flags:1  ts: 2.835837
 ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
-ret:-1         st:-1 flags:0  ts: 1.730004
+ret:-EINVAL    st:-1 flags:0  ts: 1.730004
 ret: 0         st:-1 flags:1  ts: 0.624171
 ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
 ret: 0         st: 0 flags:0  ts:-0.481662
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:458752
 ret: 0         st: 0 flags:1  ts: 2.412505
 ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
-ret:-1         st:-1 flags:0  ts: 1.306672
+ret:-EINVAL    st:-1 flags:0  ts: 1.306672
 ret: 0         st:-1 flags:1  ts: 0.200839
 ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
 ret: 0         st: 0 flags:0  ts:-0.904994
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:458752
 ret: 0         st: 0 flags:1  ts: 1.989173
 ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
-ret:-1         st:-1 flags:0  ts: 0.883340
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.671674
+ret:-EINVAL    st:-1 flags:0  ts: 0.883340
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.671674
 ret: 0         st: 0 flags:1  ts: 1.565841
 ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
-ret:-1         st:-1 flags:0  ts: 0.460008
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:0  ts: 0.460008
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-dnxhd-720p-rd b/tests/ref/seek/vsynth2-dnxhd-720p-rd
index b57f07d..b165d30 100644
--- a/tests/ref/seek/vsynth2-dnxhd-720p-rd
+++ b/tests/ref/seek/vsynth2-dnxhd-720p-rd
@@ -3,38 +3,38 @@ ret: 0         st:-1 flags:0  ts:-1.000000
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:458752
 ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
-ret:-1         st: 0 flags:0  ts: 0.788334
-ret:-1         st: 0 flags:1  ts:-0.317499
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:0  ts: 0.788334
+ret:-EINVAL    st: 0 flags:1  ts:-0.317499
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
-ret:-1         st: 0 flags:0  ts: 0.365002
-ret:-1         st: 0 flags:1  ts:-0.740831
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:0  ts: 0.365002
+ret:-EINVAL    st: 0 flags:1  ts:-0.740831
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
 ret: 0         st: 0 flags:0  ts:-0.058330
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:458752
 ret: 0         st: 0 flags:1  ts: 2.835837
 ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
-ret:-1         st:-1 flags:0  ts: 1.730004
+ret:-EINVAL    st:-1 flags:0  ts: 1.730004
 ret: 0         st:-1 flags:1  ts: 0.624171
 ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
 ret: 0         st: 0 flags:0  ts:-0.481662
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:458752
 ret: 0         st: 0 flags:1  ts: 2.412505
 ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
-ret:-1         st:-1 flags:0  ts: 1.306672
+ret:-EINVAL    st:-1 flags:0  ts: 1.306672
 ret: 0         st:-1 flags:1  ts: 0.200839
 ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
 ret: 0         st: 0 flags:0  ts:-0.904994
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:458752
 ret: 0         st: 0 flags:1  ts: 1.989173
 ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
-ret:-1         st:-1 flags:0  ts: 0.883340
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.671674
+ret:-EINVAL    st:-1 flags:0  ts: 0.883340
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.671674
 ret: 0         st: 0 flags:1  ts: 1.565841
 ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
-ret:-1         st:-1 flags:0  ts: 0.460008
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:0  ts: 0.460008
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-ffv1 b/tests/ref/seek/vsynth2-ffv1
index 84e7436..629e665 100644
--- a/tests/ref/seek/vsynth2-ffv1
+++ b/tests/ref/seek/vsynth2-ffv1
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:2499438 size: 75965
 ret: 0         st: 0 flags:0  ts: 0.800000
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:1631570 size: 72710
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.320000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:2499438 size: 75965
 ret: 0         st: 0 flags:0  ts: 0.360000
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 801634 size: 69485
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.760000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:1631570 size: 72710
 ret: 0         st: 0 flags:0  ts:-0.040000
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 2.000000
 ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos:3393890 size: 77489
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:1631570 size: 72710
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.680000
 ret: 0         st: 0 flags:1  ts: 1.560000
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:2499438 size: 75965
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 801634 size: 69485
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-flashsv b/tests/ref/seek/vsynth2-flashsv
index 8bfb2fc..c8a123e 100644
--- a/tests/ref/seek/vsynth2-flashsv
+++ b/tests/ref/seek/vsynth2-flashsv
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos:11605762 size:254053
 ret: 0         st: 0 flags:0  ts: 0.788000
 ret: 0         st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos:4820517 size:245503
-ret:-1         st: 0 flags:1  ts:-0.317000
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.317000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:8811911 size:253041
 ret: 0         st: 0 flags:0  ts: 0.365000
 ret: 0         st: 0 flags:1 dts: 0.400000 pts: 0.400000 pos:2387452 size:241101
-ret:-1         st: 0 flags:1  ts:-0.741000
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.741000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos:6302834 size:248927
 ret: 0         st: 0 flags:0  ts:-0.058000
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 1.989000
 ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:12114712 size:254237
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.920000 pts: 0.920000 pos:5559238 size:247341
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.672000
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.672000
 ret: 0         st: 0 flags:1  ts: 1.566000
 ret: 0         st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos:9572247 size:254219
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:2870253 size:242377
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-flv b/tests/ref/seek/vsynth2-flv
index d4aecda..08146ac 100644
--- a/tests/ref/seek/vsynth2-flv
+++ b/tests/ref/seek/vsynth2-flv
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  83240 size: 12295
 ret: 0         st: 0 flags:0  ts: 0.788000
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  52585 size: 11127
-ret:-1         st: 0 flags:1  ts:-0.317000
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.317000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  83240 size: 12295
 ret: 0         st: 0 flags:0  ts: 0.365000
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  25960 size: 10089
-ret:-1         st: 0 flags:1  ts:-0.741000
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.741000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  52585 size: 11127
 ret: 0         st: 0 flags:0  ts:-0.058000
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 1.989000
 ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 117177 size: 12730
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  52585 size: 11127
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.672000
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.672000
 ret: 0         st: 0 flags:1  ts: 1.566000
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  83240 size: 12295
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  25960 size: 10089
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-h261 b/tests/ref/seek/vsynth2-h261
index 48ee00f..8118c83 100644
--- a/tests/ref/seek/vsynth2-h261
+++ b/tests/ref/seek/vsynth2-h261
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 126494 size: 11377
 ret: 0         st: 0 flags:0  ts: 0.800000
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  82052 size: 10322
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.320000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 126494 size: 11377
 ret: 0         st: 0 flags:0  ts: 0.360000
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  44664 size:  9404
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.760000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  82052 size: 10322
 ret: 0         st: 0 flags:0  ts:-0.040000
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 2.000000
 ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 175856 size: 11707
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  82052 size: 10322
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.680000
 ret: 0         st: 0 flags:1  ts: 1.560000
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 126494 size: 11377
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  44664 size:  9404
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-h263 b/tests/ref/seek/vsynth2-h263
index 6b7df48..d2a333b 100644
--- a/tests/ref/seek/vsynth2-h263
+++ b/tests/ref/seek/vsynth2-h263
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 103702 size: 12296
 ret: 0         st: 0 flags:0  ts: 0.800000
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  66792 size: 11128
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.320000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 103702 size: 12296
 ret: 0         st: 0 flags:0  ts: 0.360000
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  36438 size: 10090
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.760000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  66792 size: 11128
 ret: 0         st: 0 flags:0  ts:-0.040000
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 2.000000
 ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 144552 size: 12731
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  66792 size: 11128
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.680000
 ret: 0         st: 0 flags:1  ts: 1.560000
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 103702 size: 12296
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  36438 size: 10090
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-h263p b/tests/ref/seek/vsynth2-h263p
index 7dd4852..5c908bd 100644
--- a/tests/ref/seek/vsynth2-h263p
+++ b/tests/ref/seek/vsynth2-h263p
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 569918 size: 45151
 ret: 0         st: 0 flags:0  ts: 0.800000
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 355968 size: 40907
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.320000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 569918 size: 45151
 ret: 0         st: 0 flags:0  ts: 0.360000
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 171042 size: 36514
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.760000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 355968 size: 40907
 ret: 0         st: 0 flags:0  ts:-0.040000
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 2.000000
 ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 804358 size: 46411
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 355968 size: 40907
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.680000
 ret: 0         st: 0 flags:1  ts: 1.560000
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 569918 size: 45151
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 171042 size: 36514
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-huffyuv b/tests/ref/seek/vsynth2-huffyuv
index ad01899..353db1d 100644
--- a/tests/ref/seek/vsynth2-huffyuv
+++ b/tests/ref/seek/vsynth2-huffyuv
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos:5744998 size:121152
 ret: 0         st: 0 flags:0  ts: 0.800000
 ret: 0         st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos:2437994 size:122516
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.320000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos:4523454 size:122784
 ret: 0         st: 0 flags:0  ts: 0.360000
 ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos:1093870 size:121320
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.760000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos:3173590 size:122784
 ret: 0         st: 0 flags:0  ts:-0.040000
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 2.000000
 ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:5987030 size:120672
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos:2683062 size:122588
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.680000
 ret: 0         st: 0 flags:1  ts: 1.560000
 ret: 0         st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos:4768978 size:122556
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:1458406 size:121888
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-jpegls b/tests/ref/seek/vsynth2-jpegls
index 3c0da21..9800019 100644
--- a/tests/ref/seek/vsynth2-jpegls
+++ b/tests/ref/seek/vsynth2-jpegls
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos:7804118 size:176295
 ret: 0         st: 0 flags:0  ts: 0.800000
 ret: 0         st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos:3172780 size:164643
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.320000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos:6052974 size:174097
 ret: 0         st: 0 flags:0  ts: 0.360000
 ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos:1402344 size:157283
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.760000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos:4170248 size:168401
 ret: 0         st: 0 flags:0  ts:-0.040000
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 2.000000
 ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:8157016 size:176793
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos:3502828 size:166017
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.680000
 ret: 0         st: 0 flags:1  ts: 1.560000
 ret: 0         st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos:6401452 size:174815
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:1876416 size:159659
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-ljpeg b/tests/ref/seek/vsynth2-ljpeg
index 1ca1441..1f9a9eb 100644
--- a/tests/ref/seek/vsynth2-ljpeg
+++ b/tests/ref/seek/vsynth2-ljpeg
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos:4478624 size: 94801
 ret: 0         st: 0 flags:0  ts: 0.800000
 ret: 0         st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos:1900940 size: 95396
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.320000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos:3525172 size: 95655
 ret: 0         st: 0 flags:0  ts: 0.360000
 ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos: 854322 size: 94566
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.760000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos:2473776 size: 95580
 ret: 0         st: 0 flags:0  ts:-0.040000
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 2.000000
 ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:4668120 size: 94526
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos:2091786 size: 95459
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.680000
 ret: 0         st: 0 flags:1  ts: 1.560000
 ret: 0         st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos:3716438 size: 95546
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:1138408 size: 94963
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-mjpeg b/tests/ref/seek/vsynth2-mjpeg
index c1395a9..c82c920 100644
--- a/tests/ref/seek/vsynth2-mjpeg
+++ b/tests/ref/seek/vsynth2-mjpeg
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos: 627814 size: 14806
 ret: 0         st: 0 flags:0  ts: 0.800000
 ret: 0         st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos: 247498 size: 12959
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.320000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos: 480736 size: 14519
 ret: 0         st: 0 flags:0  ts: 0.360000
 ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos: 110996 size: 11924
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.760000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos: 326680 size: 13491
 ret: 0         st: 0 flags:0  ts:-0.040000
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 2.000000
 ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 657468 size: 14897
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos: 273512 size: 13122
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.680000
 ret: 0         st: 0 flags:1  ts: 1.560000
 ret: 0         st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos: 509892 size: 14594
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146950 size: 12173
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-mpeg1 b/tests/ref/seek/vsynth2-mpeg1
index 0ec751a..095421e 100644
--- a/tests/ref/seek/vsynth2-mpeg1
+++ b/tests/ref/seek/vsynth2-mpeg1
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: NOPTS    pos: 124255 size: 11796
 ret: 0         st: 0 flags:0  ts: 0.788334
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: NOPTS    pos:  76706 size: 10792
-ret:-1         st: 0 flags:1  ts:-0.317499
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.317499
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: NOPTS    pos: 124255 size: 11796
 ret: 0         st: 0 flags:0  ts: 0.365002
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: NOPTS    pos:  37721 size:  9873
-ret:-1         st: 0 flags:1  ts:-0.740831
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.740831
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: NOPTS    pos:  76706 size: 10792
 ret: 0         st: 0 flags:0  ts:-0.058330
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 1.989173
 ret: 0         st: 0 flags:1 dts: 1.920000 pts: NOPTS    pos: 177099 size: 12057
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: NOPTS    pos:  76706 size: 10792
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.671674
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.671674
 ret: 0         st: 0 flags:1  ts: 1.565841
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: NOPTS    pos: 124255 size: 11796
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: NOPTS    pos:  37721 size:  9873
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-mpeg1b b/tests/ref/seek/vsynth2-mpeg1b
index e079e34..b684b7c 100644
--- a/tests/ref/seek/vsynth2-mpeg1b
+++ b/tests/ref/seek/vsynth2-mpeg1b
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.800000 pts: NOPTS    pos: 194424 size: 14837
 ret: 0         st: 0 flags:0  ts: 0.788334
 ret: 0         st: 0 flags:1 dts: 0.840000 pts: NOPTS    pos:  80757 size: 13267
-ret:-1         st: 0 flags:1  ts:-0.317499
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.317499
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.320000 pts: NOPTS    pos: 133899 size: 14470
 ret: 0         st: 0 flags:0  ts: 0.365002
 ret: 0         st: 0 flags:1 dts: 0.840000 pts: NOPTS    pos:  80757 size: 13267
-ret:-1         st: 0 flags:1  ts:-0.740831
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.740831
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.840000 pts: NOPTS    pos:  80757 size: 13267
 ret: 0         st: 0 flags:0  ts:-0.058330
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 1.989173
 ret: 0         st: 0 flags:1 dts: 1.800000 pts: NOPTS    pos: 194424 size: 14837
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 1.320000 pts: NOPTS    pos: 133899 size: 14470
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.671674
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.671674
 ret: 0         st: 0 flags:1  ts: 1.565841
 ret: 0         st: 0 flags:1 dts: 1.320000 pts: NOPTS    pos: 133899 size: 14470
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.840000 pts: NOPTS    pos:  80757 size: 13267
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-mpeg2-422 b/tests/ref/seek/vsynth2-mpeg2-422
index 06d8f7a..d450a09 100644
--- a/tests/ref/seek/vsynth2-mpeg2-422
+++ b/tests/ref/seek/vsynth2-mpeg2-422
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 325397 size: 19967
 ret: 0         st: 0 flags:0  ts: 0.788334
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 200747 size: 22575
-ret:-1         st: 0 flags:1  ts:-0.317499
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.317499
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 265466 size: 21329
 ret: 0         st: 0 flags:0  ts: 0.365002
 ret: 0         st: 0 flags:1 dts: 0.400000 pts: NOPTS    pos: 104454 size: 28984
-ret:-1         st: 0 flags:1  ts:-0.740831
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.740831
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 200747 size: 22575
 ret: 0         st: 0 flags:0  ts:-0.058330
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 1.989173
 ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 325397 size: 19967
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 265466 size: 21329
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.671674
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.671674
 ret: 0         st: 0 flags:1  ts: 1.565841
 ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 265466 size: 21329
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 200747 size: 22575
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-mpeg2-idct-int b/tests/ref/seek/vsynth2-mpeg2-idct-int
index b096f6f..4ae3362 100644
--- a/tests/ref/seek/vsynth2-mpeg2-idct-int
+++ b/tests/ref/seek/vsynth2-mpeg2-idct-int
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: NOPTS    pos: 127925 size: 11918
 ret: 0         st: 0 flags:0  ts: 0.788334
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: NOPTS    pos:  79103 size: 10909
-ret:-1         st: 0 flags:1  ts:-0.317499
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.317499
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: NOPTS    pos: 127925 size: 11918
 ret: 0         st: 0 flags:0  ts: 0.365002
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: NOPTS    pos:  38992 size:  9985
-ret:-1         st: 0 flags:1  ts:-0.740831
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.740831
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: NOPTS    pos:  79103 size: 10909
 ret: 0         st: 0 flags:0  ts:-0.058330
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 1.989173
 ret: 0         st: 0 flags:1 dts: 1.920000 pts: NOPTS    pos: 182138 size: 12183
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: NOPTS    pos:  79103 size: 10909
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.671674
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.671674
 ret: 0         st: 0 flags:1  ts: 1.565841
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: NOPTS    pos: 127925 size: 11918
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: NOPTS    pos:  38992 size:  9985
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-mpeg2-ilace b/tests/ref/seek/vsynth2-mpeg2-ilace
index d2a7838..26f75b5 100644
--- a/tests/ref/seek/vsynth2-mpeg2-ilace
+++ b/tests/ref/seek/vsynth2-mpeg2-ilace
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: NOPTS    pos: 132603 size: 11970
 ret: 0         st: 0 flags:0  ts: 0.788334
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: NOPTS    pos:  82152 size: 10965
-ret:-1         st: 0 flags:1  ts:-0.317499
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.317499
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: NOPTS    pos: 132603 size: 11970
 ret: 0         st: 0 flags:0  ts: 0.365002
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: NOPTS    pos:  40546 size: 10045
-ret:-1         st: 0 flags:1  ts:-0.740831
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.740831
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: NOPTS    pos:  82152 size: 10965
 ret: 0         st: 0 flags:0  ts:-0.058330
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 1.989173
 ret: 0         st: 0 flags:1 dts: 1.920000 pts: NOPTS    pos: 188425 size: 12232
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: NOPTS    pos:  82152 size: 10965
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.671674
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.671674
 ret: 0         st: 0 flags:1  ts: 1.565841
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: NOPTS    pos: 132603 size: 11970
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: NOPTS    pos:  40546 size: 10045
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-mpeg2-ivlc-qprd b/tests/ref/seek/vsynth2-mpeg2-ivlc-qprd
index 330dc16..f006095 100644
--- a/tests/ref/seek/vsynth2-mpeg2-ivlc-qprd
+++ b/tests/ref/seek/vsynth2-mpeg2-ivlc-qprd
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 227500 size: 12725
 ret: 0         st: 0 flags:0  ts: 0.788334
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 164167 size: 13921
-ret:-1         st: 0 flags:1  ts:-0.317499
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.317499
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 196681 size: 13159
 ret: 0         st: 0 flags:0  ts: 0.365002
 ret: 0         st: 0 flags:1 dts: 0.400000 pts: NOPTS    pos:  98748 size: 29165
-ret:-1         st: 0 flags:1  ts:-0.740831
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.740831
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 164167 size: 13921
 ret: 0         st: 0 flags:0  ts:-0.058330
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 1.989173
 ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 227500 size: 12725
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 196681 size: 13159
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.671674
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.671674
 ret: 0         st: 0 flags:1  ts: 1.565841
 ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 196681 size: 13159
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 164167 size: 13921
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-mpeg2-thread b/tests/ref/seek/vsynth2-mpeg2-thread
index 8e16f43..d2374a5 100644
--- a/tests/ref/seek/vsynth2-mpeg2-thread
+++ b/tests/ref/seek/vsynth2-mpeg2-thread
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 158232 size: 12232
 ret: 0         st: 0 flags:0  ts: 0.788334
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos:  67783 size: 10965
-ret:-1         st: 0 flags:1  ts:-0.317499
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.317499
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 110336 size: 11970
 ret: 0         st: 0 flags:0  ts: 0.365002
 ret: 0         st: 0 flags:1 dts: 0.400000 pts: NOPTS    pos:  30747 size: 10045
-ret:-1         st: 0 flags:1  ts:-0.740831
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.740831
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos:  67783 size: 10965
 ret: 0         st: 0 flags:0  ts:-0.058330
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 1.989173
 ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 158232 size: 12232
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 110336 size: 11970
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.671674
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.671674
 ret: 0         st: 0 flags:1  ts: 1.565841
 ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 110336 size: 11970
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos:  67783 size: 10965
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-mpeg2-thread-ivlc b/tests/ref/seek/vsynth2-mpeg2-thread-ivlc
index 49ec819..79e751b 100644
--- a/tests/ref/seek/vsynth2-mpeg2-thread-ivlc
+++ b/tests/ref/seek/vsynth2-mpeg2-thread-ivlc
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 157685 size: 11930
 ret: 0         st: 0 flags:0  ts: 0.788334
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos:  67716 size: 10791
-ret:-1         st: 0 flags:1  ts:-0.317499
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.317499
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 110086 size: 11697
 ret: 0         st: 0 flags:0  ts: 0.365002
 ret: 0         st: 0 flags:1 dts: 0.400000 pts: NOPTS    pos:  30744 size:  9980
-ret:-1         st: 0 flags:1  ts:-0.740831
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.740831
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos:  67716 size: 10791
 ret: 0         st: 0 flags:0  ts:-0.058330
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 1.989173
 ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 157685 size: 11930
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 110086 size: 11697
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.671674
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.671674
 ret: 0         st: 0 flags:1  ts: 1.565841
 ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 110086 size: 11697
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos:  67716 size: 10791
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-mpeg4 b/tests/ref/seek/vsynth2-mpeg4
index b1c8a19..d2a5f94 100644
--- a/tests/ref/seek/vsynth2-mpeg4
+++ b/tests/ref/seek/vsynth2-mpeg4
@@ -7,14 +7,14 @@ ret: 0         st: 0 flags:0  ts: 0.788359
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  47228 size:  9634
 ret: 0         st: 0 flags:1  ts:-0.317500
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     44 size:  8719
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  75140 size: 10776
 ret: 0         st: 0 flags:0  ts: 0.365000
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  23271 size:  8524
 ret: 0         st: 0 flags:1  ts:-0.740859
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     44 size:  8719
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  47228 size:  9634
 ret: 0         st: 0 flags:0  ts:-0.058359
@@ -41,7 +41,7 @@ ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  47228 size:  9634
 ret: 0         st:-1 flags:1  ts:-0.222493
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     44 size:  8719
-ret:-1         st: 0 flags:0  ts: 2.671641
+ret:-EINVAL    st: 0 flags:0  ts: 2.671641
 ret: 0         st: 0 flags:1  ts: 1.565859
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  75140 size: 10776
 ret: 0         st:-1 flags:0  ts: 0.460008
diff --git a/tests/ref/seek/vsynth2-mpeg4-adap b/tests/ref/seek/vsynth2-mpeg4-adap
index cb6beee..6ed828a 100644
--- a/tests/ref/seek/vsynth2-mpeg4-adap
+++ b/tests/ref/seek/vsynth2-mpeg4-adap
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 174442 size: 16883
 ret: 0         st: 0 flags:0  ts: 0.800000
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos:  98216 size: 17063
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.320000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 135578 size: 17525
 ret: 0         st: 0 flags:0  ts: 0.360000
 ret: 0         st: 0 flags:1 dts: 0.400000 pts: NOPTS    pos:  59442 size: 17261
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.760000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos:  98216 size: 17063
 ret: 0         st: 0 flags:0  ts:-0.040000
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 2.000000
 ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 174442 size: 16883
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos:  98216 size: 17063
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.680000
 ret: 0         st: 0 flags:1  ts: 1.560000
 ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 135578 size: 17525
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos:  98216 size: 17063
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-mpeg4-adv b/tests/ref/seek/vsynth2-mpeg4-adv
index 6765864..5c568d0 100644
--- a/tests/ref/seek/vsynth2-mpeg4-adv
+++ b/tests/ref/seek/vsynth2-mpeg4-adv
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  91718 size: 11013
 ret: 0         st: 0 flags:0  ts: 0.800000
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  59492 size:  9815
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.320000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  91718 size: 11013
 ret: 0         st: 0 flags:0  ts: 0.360000
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  31932 size:  8753
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.760000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  59492 size:  9815
 ret: 0         st: 0 flags:0  ts:-0.040000
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 2.000000
 ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 127612 size: 11279
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  59492 size:  9815
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.680000
 ret: 0         st: 0 flags:1  ts: 1.560000
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  91718 size: 11013
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  31932 size:  8753
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-mpeg4-error b/tests/ref/seek/vsynth2-mpeg4-error
index e31df5d..8a3686f 100644
--- a/tests/ref/seek/vsynth2-mpeg4-error
+++ b/tests/ref/seek/vsynth2-mpeg4-error
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 113182 size: 15063
 ret: 0         st: 0 flags:0  ts: 0.800000
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  73142 size: 10235
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.320000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 113182 size: 15063
 ret: 0         st: 0 flags:0  ts: 0.360000
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  38228 size: 10303
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.760000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  73142 size: 10235
 ret: 0         st: 0 flags:0  ts:-0.040000
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 2.000000
 ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 163064 size: 13980
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  73142 size: 10235
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.680000
 ret: 0         st: 0 flags:1  ts: 1.560000
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 113182 size: 15063
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  38228 size: 10303
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-mpeg4-nr b/tests/ref/seek/vsynth2-mpeg4-nr
index 3d6b5ce..c1d9d70 100644
--- a/tests/ref/seek/vsynth2-mpeg4-nr
+++ b/tests/ref/seek/vsynth2-mpeg4-nr
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 100652 size: 12464
 ret: 0         st: 0 flags:0  ts: 0.800000
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  65488 size: 11180
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.320000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 100652 size: 12464
 ret: 0         st: 0 flags:0  ts: 0.360000
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  35310 size:  9987
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.760000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  65488 size: 11180
 ret: 0         st: 0 flags:0  ts:-0.040000
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 2.000000
 ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139372 size: 12911
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  65488 size: 11180
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.680000
 ret: 0         st: 0 flags:1  ts: 1.560000
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 100652 size: 12464
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  35310 size:  9987
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-mpeg4-nsse b/tests/ref/seek/vsynth2-mpeg4-nsse
index 8e2a95f..bb32b90 100644
--- a/tests/ref/seek/vsynth2-mpeg4-nsse
+++ b/tests/ref/seek/vsynth2-mpeg4-nsse
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 127872 size: 15054
 ret: 0         st: 0 flags:0  ts: 0.800000
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  81652 size: 13376
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.320000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 127872 size: 15054
 ret: 0         st: 0 flags:0  ts: 0.360000
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  42638 size: 11805
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.760000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  81652 size: 13376
 ret: 0         st: 0 flags:0  ts:-0.040000
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 2.000000
 ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 179512 size: 15553
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  81652 size: 13376
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.680000
 ret: 0         st: 0 flags:1  ts: 1.560000
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 127872 size: 15054
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  42638 size: 11805
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-mpeg4-qpel b/tests/ref/seek/vsynth2-mpeg4-qpel
index cd6eaf0..9ee386a 100644
--- a/tests/ref/seek/vsynth2-mpeg4-qpel
+++ b/tests/ref/seek/vsynth2-mpeg4-qpel
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 141526 size: 15554
 ret: 0         st: 0 flags:0  ts: 0.800000
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos:  64110 size: 13377
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.320000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 100336 size: 15055
 ret: 0         st: 0 flags:0  ts: 0.360000
 ret: 0         st: 0 flags:1 dts: 0.400000 pts: NOPTS    pos:  32836 size: 11806
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.760000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos:  64110 size: 13377
 ret: 0         st: 0 flags:0  ts:-0.040000
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 2.000000
 ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 141526 size: 15554
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos:  64110 size: 13377
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.680000
 ret: 0         st: 0 flags:1  ts: 1.560000
 ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 100336 size: 15055
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos:  64110 size: 13377
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-mpeg4-qprd b/tests/ref/seek/vsynth2-mpeg4-qprd
index 74aee79..42a0051 100644
--- a/tests/ref/seek/vsynth2-mpeg4-qprd
+++ b/tests/ref/seek/vsynth2-mpeg4-qprd
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 211030 size: 14638
 ret: 0         st: 0 flags:0  ts: 0.800000
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 150654 size: 14502
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.320000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 180778 size: 14371
 ret: 0         st: 0 flags:0  ts: 0.360000
 ret: 0         st: 0 flags:1 dts: 0.400000 pts: NOPTS    pos:  93024 size: 29366
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.760000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 150654 size: 14502
 ret: 0         st: 0 flags:0  ts:-0.040000
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 2.000000
 ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 211030 size: 14638
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 150654 size: 14502
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.680000
 ret: 0         st: 0 flags:1  ts: 1.560000
 ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 180778 size: 14371
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 150654 size: 14502
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-mpeg4-rc b/tests/ref/seek/vsynth2-mpeg4-rc
index 6bcfd48..e8ed787 100644
--- a/tests/ref/seek/vsynth2-mpeg4-rc
+++ b/tests/ref/seek/vsynth2-mpeg4-rc
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 207950 size: 13826
 ret: 0         st: 0 flags:0  ts: 0.800000
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 153784 size: 13377
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.320000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 180946 size: 13326
 ret: 0         st: 0 flags:0  ts: 0.360000
 ret: 0         st: 0 flags:1 dts: 0.400000 pts: NOPTS    pos:  94574 size: 32807
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.760000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 153784 size: 13377
 ret: 0         st: 0 flags:0  ts:-0.040000
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 2.000000
 ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 207950 size: 13826
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 153784 size: 13377
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.680000
 ret: 0         st: 0 flags:1  ts: 1.560000
 ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 180946 size: 13326
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 153784 size: 13377
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-mpeg4-thread b/tests/ref/seek/vsynth2-mpeg4-thread
index ca849f3..85f2eef 100644
--- a/tests/ref/seek/vsynth2-mpeg4-thread
+++ b/tests/ref/seek/vsynth2-mpeg4-thread
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 228186 size: 16323
 ret: 0         st: 0 flags:0  ts: 0.800000
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 162156 size: 16462
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.320000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 195330 size: 16153
 ret: 0         st: 0 flags:0  ts: 0.360000
 ret: 0         st: 0 flags:1 dts: 0.400000 pts: NOPTS    pos:  97832 size: 33332
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.760000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 162156 size: 16462
 ret: 0         st: 0 flags:0  ts:-0.040000
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 2.000000
 ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 228186 size: 16323
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 162156 size: 16462
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.680000
 ret: 0         st: 0 flags:1  ts: 1.560000
 ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 195330 size: 16153
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 162156 size: 16462
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-msmpeg4 b/tests/ref/seek/vsynth2-msmpeg4
index e096f76..b5cafc9 100644
--- a/tests/ref/seek/vsynth2-msmpeg4
+++ b/tests/ref/seek/vsynth2-msmpeg4
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  82508 size: 10783
 ret: 0         st: 0 flags:0  ts: 0.800000
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  53846 size:  9624
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.320000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  82508 size: 10783
 ret: 0         st: 0 flags:0  ts: 0.360000
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  29388 size:  8502
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.760000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  53846 size:  9624
 ret: 0         st: 0 flags:0  ts:-0.040000
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 2.000000
 ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 114256 size: 11180
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  53846 size:  9624
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.680000
 ret: 0         st: 0 flags:1  ts: 1.560000
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  82508 size: 10783
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  29388 size:  8502
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-msmpeg4v2 b/tests/ref/seek/vsynth2-msmpeg4v2
index 00a175d..ded7d68 100644
--- a/tests/ref/seek/vsynth2-msmpeg4v2
+++ b/tests/ref/seek/vsynth2-msmpeg4v2
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  83870 size: 11165
 ret: 0         st: 0 flags:0  ts: 0.800000
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  54778 size: 10010
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.320000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  83870 size: 11165
 ret: 0         st: 0 flags:0  ts: 0.360000
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  29770 size:  8869
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.760000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  54778 size: 10010
 ret: 0         st: 0 flags:0  ts:-0.040000
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 2.000000
 ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116112 size: 11578
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  54778 size: 10010
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.680000
 ret: 0         st: 0 flags:1  ts: 1.560000
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  83870 size: 11165
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  29770 size:  8869
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-rgb b/tests/ref/seek/vsynth2-rgb
index 91f7260..7eb414f 100644
--- a/tests/ref/seek/vsynth2-rgb
+++ b/tests/ref/seek/vsynth2-rgb
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos:14300040 size:304128
 ret: 0         st: 0 flags:0  ts: 0.800000
 ret: 0         st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos:6088368 size:304128
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.320000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos:11258680 size:304128
 ret: 0         st: 0 flags:0  ts: 0.360000
 ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos:2742872 size:304128
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.760000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos:7913184 size:304128
 ret: 0         st: 0 flags:0  ts:-0.040000
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 2.000000
 ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:14908312 size:304128
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos:6696640 size:304128
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.680000
 ret: 0         st: 0 flags:1  ts: 1.560000
 ret: 0         st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos:11866952 size:304128
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:3655280 size:304128
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-roqvideo b/tests/ref/seek/vsynth2-roqvideo
index 50a0a33..1f6edac 100644
--- a/tests/ref/seek/vsynth2-roqvideo
+++ b/tests/ref/seek/vsynth2-roqvideo
@@ -1,27 +1,27 @@
 ret: 0         st: 0 flags:0 dts: 0.000000 pts: 0.000000 pos:     24 size: 26814
-ret:-1         st:-1 flags:0  ts:-1.000000
-ret:-1         st:-1 flags:1  ts: 1.894167
-ret:-1         st: 0 flags:0  ts: 0.800000
-ret:-1         st: 0 flags:1  ts:-0.333333
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret:-1         st:-1 flags:1  ts: 1.470835
-ret:-1         st: 0 flags:0  ts: 0.366667
-ret:-1         st: 0 flags:1  ts:-0.733333
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret:-1         st:-1 flags:1  ts: 1.047503
-ret:-1         st: 0 flags:0  ts:-0.066667
-ret:-1         st: 0 flags:1  ts: 2.833333
-ret:-1         st:-1 flags:0  ts: 1.730004
-ret:-1         st:-1 flags:1  ts: 0.624171
-ret:-1         st: 0 flags:0  ts:-0.466667
-ret:-1         st: 0 flags:1  ts: 2.400000
-ret:-1         st:-1 flags:0  ts: 1.306672
-ret:-1         st:-1 flags:1  ts: 0.200839
-ret:-1         st: 0 flags:0  ts:-0.900000
-ret:-1         st: 0 flags:1  ts: 2.000000
-ret:-1         st:-1 flags:0  ts: 0.883340
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.666667
-ret:-1         st: 0 flags:1  ts: 1.566667
-ret:-1         st:-1 flags:0  ts: 0.460008
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:0  ts:-1.000000
+ret:-EINVAL    st:-1 flags:1  ts: 1.894167
+ret:-EINVAL    st: 0 flags:0  ts: 0.800000
+ret:-EINVAL    st: 0 flags:1  ts:-0.333333
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st:-1 flags:1  ts: 1.470835
+ret:-EINVAL    st: 0 flags:0  ts: 0.366667
+ret:-EINVAL    st: 0 flags:1  ts:-0.733333
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st:-1 flags:1  ts: 1.047503
+ret:-EINVAL    st: 0 flags:0  ts:-0.066667
+ret:-EINVAL    st: 0 flags:1  ts: 2.833333
+ret:-EINVAL    st:-1 flags:0  ts: 1.730004
+ret:-EINVAL    st:-1 flags:1  ts: 0.624171
+ret:-EINVAL    st: 0 flags:0  ts:-0.466667
+ret:-EINVAL    st: 0 flags:1  ts: 2.400000
+ret:-EINVAL    st:-1 flags:0  ts: 1.306672
+ret:-EINVAL    st:-1 flags:1  ts: 0.200839
+ret:-EINVAL    st: 0 flags:0  ts:-0.900000
+ret:-EINVAL    st: 0 flags:1  ts: 2.000000
+ret:-EINVAL    st:-1 flags:0  ts: 0.883340
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.666667
+ret:-EINVAL    st: 0 flags:1  ts: 1.566667
+ret:-EINVAL    st:-1 flags:0  ts: 0.460008
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-snow b/tests/ref/seek/vsynth2-snow
index d8f5aae..96a04a5 100644
--- a/tests/ref/seek/vsynth2-snow
+++ b/tests/ref/seek/vsynth2-snow
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  39714 size:  3640
 ret: 0         st: 0 flags:0  ts: 0.800000
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  27434 size:  3494
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.320000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  39714 size:  3640
 ret: 0         st: 0 flags:0  ts: 0.360000
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  16124 size:  3244
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.760000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  27434 size:  3494
 ret: 0         st: 0 flags:0  ts:-0.040000
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 2.000000
 ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos:  52604 size:  3582
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  27434 size:  3494
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.680000
 ret: 0         st: 0 flags:1  ts: 1.560000
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  39714 size:  3640
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  16124 size:  3244
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-snow-ll b/tests/ref/seek/vsynth2-snow-ll
index 95a4a79..d7d0b66 100644
--- a/tests/ref/seek/vsynth2-snow-ll
+++ b/tests/ref/seek/vsynth2-snow-ll
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:1902788 size: 78837
 ret: 0         st: 0 flags:0  ts: 0.800000
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:1239090 size: 74994
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.320000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:1902788 size: 78837
 ret: 0         st: 0 flags:0  ts: 0.360000
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 605628 size: 71059
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.760000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:1239090 size: 74994
 ret: 0         st: 0 flags:0  ts:-0.040000
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 2.000000
 ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos:2585614 size: 79731
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:1239090 size: 74994
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.680000
 ret: 0         st: 0 flags:1  ts: 1.560000
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:1902788 size: 78837
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 605628 size: 71059
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-svq1 b/tests/ref/seek/vsynth2-svq1
index 33fe33e..05c3226 100644
--- a/tests/ref/seek/vsynth2-svq1
+++ b/tests/ref/seek/vsynth2-svq1
@@ -7,14 +7,14 @@ ret: 0         st: 0 flags:0  ts: 0.788359
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326556 size: 23552
 ret: 0         st: 0 flags:1  ts:-0.317500
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size: 22300
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 517568 size: 25636
 ret: 0         st: 0 flags:0  ts: 0.365000
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 157040 size: 21896
 ret: 0         st: 0 flags:1  ts:-0.740859
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size: 22300
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326556 size: 23552
 ret: 0         st: 0 flags:0  ts:-0.058359
@@ -41,7 +41,7 @@ ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326556 size: 23552
 ret: 0         st:-1 flags:1  ts:-0.222493
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size: 22300
-ret:-1         st: 0 flags:0  ts: 2.671641
+ret:-EINVAL    st: 0 flags:0  ts: 2.671641
 ret: 0         st: 0 flags:1  ts: 1.565859
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 517568 size: 25636
 ret: 0         st:-1 flags:0  ts: 0.460008
diff --git a/tests/ref/seek/vsynth2-wmv1 b/tests/ref/seek/vsynth2-wmv1
index 0f073b2..4b4bc81 100644
--- a/tests/ref/seek/vsynth2-wmv1
+++ b/tests/ref/seek/vsynth2-wmv1
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  83742 size: 11099
 ret: 0         st: 0 flags:0  ts: 0.800000
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  54758 size:  9931
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.320000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  83742 size: 11099
 ret: 0         st: 0 flags:0  ts: 0.360000
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  29794 size:  8796
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.760000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  54758 size:  9931
 ret: 0         st: 0 flags:0  ts:-0.040000
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 2.000000
 ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 115806 size: 11486
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  54758 size:  9931
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.680000
 ret: 0         st: 0 flags:1  ts: 1.560000
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  83742 size: 11099
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  29794 size:  8796
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-wmv2 b/tests/ref/seek/vsynth2-wmv2
index a29f0d4..9502f31 100644
--- a/tests/ref/seek/vsynth2-wmv2
+++ b/tests/ref/seek/vsynth2-wmv2
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  83764 size: 11169
 ret: 0         st: 0 flags:0  ts: 0.800000
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  54534 size:  9989
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.320000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  83764 size: 11169
 ret: 0         st: 0 flags:0  ts: 0.360000
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  29588 size:  8839
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.760000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  54534 size:  9989
 ret: 0         st: 0 flags:0  ts:-0.040000
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 2.000000
 ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116066 size: 11554
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  54534 size:  9989
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.680000
 ret: 0         st: 0 flags:1  ts: 1.560000
 ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  83764 size: 11169
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  29588 size:  8839
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth2-yuv b/tests/ref/seek/vsynth2-yuv
index d440761..3de57a7 100644
--- a/tests/ref/seek/vsynth2-yuv
+++ b/tests/ref/seek/vsynth2-yuv
@@ -5,14 +5,14 @@ ret: 0         st:-1 flags:1  ts: 1.894167
 ret: 0         st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos:7153032 size:152064
 ret: 0         st: 0 flags:0  ts: 0.800000
 ret: 0         st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos:3047088 size:152064
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
+ret:-EINVAL    st: 0 flags:1  ts:-0.320000
+ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos:5632312 size:152064
 ret: 0         st: 0 flags:0  ts: 0.360000
 ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos:1374296 size:152064
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
+ret:-EINVAL    st: 0 flags:1  ts:-0.760000
+ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos:3959520 size:152064
 ret: 0         st: 0 flags:0  ts:-0.040000
@@ -37,10 +37,10 @@ ret: 0         st: 0 flags:1  ts: 2.000000
 ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:7457176 size:152064
 ret: 0         st:-1 flags:0  ts: 0.883340
 ret: 0         st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos:3351232 size:152064
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
+ret:-EINVAL    st:-1 flags:1  ts:-0.222493
+ret:-EINVAL    st: 0 flags:0  ts: 2.680000
 ret: 0         st: 0 flags:1  ts: 1.560000
 ret: 0         st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos:5936456 size:152064
 ret: 0         st:-1 flags:0  ts: 0.460008
 ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:1830512 size:152064
-ret:-1         st:-1 flags:1  ts:-0.645825
+ret:-EINVAL    st:-1 flags:1  ts:-0.645825
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list