aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2007-11-03 06:43:29 +0000
committerKostya Shishkov <kostya.shishkov@gmail.com>2007-11-03 06:43:29 +0000
commitd447fc3132e79ace820a761d052930fe10573d23 (patch)
tree7f3fada5ffc4237b994fedaabfdfcc7da1471037
parent0ee97f0d3fd82c5752f538269eee161a5c7942cb (diff)
downloadffmpeg-d447fc3132e79ace820a761d052930fe10573d23.tar.gz
Seek regression for RM demuxer fix
Originally committed as revision 10907 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/rm.h1
-rw-r--r--libavformat/rmdec.c3
-rw-r--r--tests/seek.regression.ref110
3 files changed, 59 insertions, 55 deletions
diff --git a/libavformat/rm.h b/libavformat/rm.h
index a9673f0648..4acf226f48 100644
--- a/libavformat/rm.h
+++ b/libavformat/rm.h
@@ -51,6 +51,7 @@ typedef struct {
int videobufpos; ///< position for the next slice in the video buffer
int curpic_num; ///< picture number of current frame
int cur_slice, slices;
+ int64_t pktpos; ///< first slice position in file
/// Audio descrambling matrix parameters
uint8_t *audiobuf; ///< place to store reordered audio data
int64_t audiotimestamp; ///< Audio packet timestamp
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index 1b88766654..09776cd9ff 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -486,6 +486,7 @@ static int rm_assemble_video_frame(AVFormatContext *s, RMContext *rm, AVPacket *
rm->videobufpos = 8*rm->slices + 1;
rm->cur_slice = 0;
rm->curpic_num = pic_num;
+ rm->pktpos = url_ftell(pb);
}
if(type == 2){
len = FFMIN(len, pos);
@@ -512,6 +513,8 @@ static int rm_assemble_video_frame(AVFormatContext *s, RMContext *rm, AVPacket *
if(av_new_packet(pkt, ssize) < 0)
return AVERROR(ENOMEM);
memcpy(pkt->data, rm->videobuf, ssize);
+ pkt->pts = AV_NOPTS_VALUE;
+ pkt->pos = rm->pktpos;
return 0;
}
diff --git a/tests/seek.regression.ref b/tests/seek.regression.ref
index eafcd7e675..8843df3587 100644
--- a/tests/seek.regression.ref
+++ b/tests/seek.regression.ref
@@ -1936,114 +1936,114 @@ ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:23263 size:8524 flags:1
ret:-1 st:-1 ts:-0.645825 flags:1
----------------
tests/data/a-rv10.rm
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:239 size:10379 flags:1
+ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:239 size:10388 flags:1
ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:10637 size:1562 flags:0
+ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:10637 size:1571 flags:0
ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.480000 pts:1.480000 pos:110921 size:2040 flags:0
+ret: 0 st: 0 dts:1.480000 pts:1.480000 pos:110921 size:2049 flags:0
ret: 0 st: 0 ts:0.788000 flags:0
-ret: 0 st: 0 dts:1.000000 pts:1.000000 pos:72737 size:1630 flags:0
+ret: 0 st: 0 dts:1.000000 pts:1.000000 pos:72737 size:1639 flags:0
ret: 0 st: 0 ts:-0.317000 flags:1
-ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:10637 size:1562 flags:0
+ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:10637 size:1571 flags:0
ret: 0 st:-1 ts:2.576668 flags:0
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:152304 size:1998 flags:0
+ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:152304 size:2007 flags:0
ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.480000 pts:1.480000 pos:110921 size:2040 flags:0
+ret: 0 st: 0 dts:1.480000 pts:1.480000 pos:110921 size:2049 flags:0
ret: 0 st: 0 ts:0.365000 flags:0
-ret: 0 st: 0 dts:0.520000 pts:0.520000 pos:41239 size:1391 flags:0
+ret: 0 st: 0 dts:0.520000 pts:0.520000 pos:41239 size:1400 flags:0
ret: 0 st: 0 ts:-0.741000 flags:1
-ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:10637 size:1562 flags:0
+ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:10637 size:1571 flags:0
ret: 0 st:-1 ts:2.153336 flags:0
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:152304 size:1998 flags:0
+ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:152304 size:2007 flags:0
ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:1.000000 pts:1.000000 pos:72737 size:1630 flags:0
+ret: 0 st: 0 dts:1.000000 pts:1.000000 pos:72737 size:1639 flags:0
ret: 0 st: 0 ts:-0.058000 flags:0
-ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:10637 size:1562 flags:0
+ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:10637 size:1571 flags:0
ret: 0 st: 0 ts:2.836000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:152304 size:1998 flags:0
+ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:152304 size:2007 flags:0
ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:152304 size:1998 flags:0
+ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:152304 size:2007 flags:0
ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.520000 pts:0.520000 pos:41239 size:1391 flags:0
+ret: 0 st: 0 dts:0.520000 pts:0.520000 pos:41239 size:1400 flags:0
ret: 0 st: 0 ts:-0.482000 flags:0
-ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:10637 size:1562 flags:0
+ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:10637 size:1571 flags:0
ret: 0 st: 0 ts:2.413000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:152304 size:1998 flags:0
+ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:152304 size:2007 flags:0
ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.480000 pts:1.480000 pos:110921 size:2040 flags:0
+ret: 0 st: 0 dts:1.480000 pts:1.480000 pos:110921 size:2049 flags:0
ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:10637 size:1562 flags:0
+ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:10637 size:1571 flags:0
ret: 0 st: 0 ts:-0.905000 flags:0
-ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:10637 size:1562 flags:0
+ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:10637 size:1571 flags:0
ret: 0 st: 0 ts:1.989000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:152304 size:1998 flags:0
+ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:152304 size:2007 flags:0
ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:1.000000 pts:1.000000 pos:72737 size:1630 flags:0
+ret: 0 st: 0 dts:1.000000 pts:1.000000 pos:72737 size:1639 flags:0
ret: 0 st:-1 ts:-0.222493 flags:1
-ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:10637 size:1562 flags:0
+ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:10637 size:1571 flags:0
ret: 0 st: 0 ts:2.672000 flags:0
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:152304 size:1998 flags:0
+ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:152304 size:2007 flags:0
ret: 0 st: 0 ts:1.566000 flags:1
-ret: 0 st: 0 dts:1.480000 pts:1.480000 pos:110921 size:2040 flags:0
+ret: 0 st: 0 dts:1.480000 pts:1.480000 pos:110921 size:2049 flags:0
ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.520000 pts:0.520000 pos:41239 size:1391 flags:0
+ret: 0 st: 0 dts:0.520000 pts:0.520000 pos:41239 size:1400 flags:0
ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:10637 size:1562 flags:0
+ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:10637 size:1571 flags:0
----------------
tests/data/a-rv20.rm
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:239 size:9352 flags:1
+ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:239 size:9361 flags:1
ret: 0 st:-1 ts:-1.000000 flags:0
-ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:9610 size:1075 flags:0
+ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:9610 size:1084 flags:0
ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:1.480000 pts:1.480000 pos:95674 size:1891 flags:0
+ret: 0 st: 0 dts:1.480000 pts:1.480000 pos:95674 size:1900 flags:0
ret: 0 st: 0 ts:0.788000 flags:0
-ret: 0 st: 0 dts:1.000000 pts:1.000000 pos:63237 size:1648 flags:0
+ret: 0 st: 0 dts:1.000000 pts:1.000000 pos:63237 size:1657 flags:0
ret: 0 st: 0 ts:-0.317000 flags:1
-ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:9610 size:1075 flags:0
+ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:9610 size:1084 flags:0
ret: 0 st:-1 ts:2.576668 flags:0
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:130821 size:1905 flags:0
+ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:130821 size:1914 flags:0
ret: 0 st:-1 ts:1.470835 flags:1
-ret: 0 st: 0 dts:1.480000 pts:1.480000 pos:95674 size:1891 flags:0
+ret: 0 st: 0 dts:1.480000 pts:1.480000 pos:95674 size:1900 flags:0
ret: 0 st: 0 ts:0.365000 flags:0
-ret: 0 st: 0 dts:0.520000 pts:0.520000 pos:35101 size:1438 flags:0
+ret: 0 st: 0 dts:0.520000 pts:0.520000 pos:35101 size:1447 flags:0
ret: 0 st: 0 ts:-0.741000 flags:1
-ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:9610 size:1075 flags:0
+ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:9610 size:1084 flags:0
ret: 0 st:-1 ts:2.153336 flags:0
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:130821 size:1905 flags:0
+ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:130821 size:1914 flags:0
ret: 0 st:-1 ts:1.047503 flags:1
-ret: 0 st: 0 dts:1.000000 pts:1.000000 pos:63237 size:1648 flags:0
+ret: 0 st: 0 dts:1.000000 pts:1.000000 pos:63237 size:1657 flags:0
ret: 0 st: 0 ts:-0.058000 flags:0
-ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:9610 size:1075 flags:0
+ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:9610 size:1084 flags:0
ret: 0 st: 0 ts:2.836000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:130821 size:1905 flags:0
+ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:130821 size:1914 flags:0
ret: 0 st:-1 ts:1.730004 flags:0
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:130821 size:1905 flags:0
+ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:130821 size:1914 flags:0
ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.520000 pts:0.520000 pos:35101 size:1438 flags:0
+ret: 0 st: 0 dts:0.520000 pts:0.520000 pos:35101 size:1447 flags:0
ret: 0 st: 0 ts:-0.482000 flags:0
-ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:9610 size:1075 flags:0
+ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:9610 size:1084 flags:0
ret: 0 st: 0 ts:2.413000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:130821 size:1905 flags:0
+ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:130821 size:1914 flags:0
ret: 0 st:-1 ts:1.306672 flags:0
-ret: 0 st: 0 dts:1.480000 pts:1.480000 pos:95674 size:1891 flags:0
+ret: 0 st: 0 dts:1.480000 pts:1.480000 pos:95674 size:1900 flags:0
ret: 0 st:-1 ts:0.200839 flags:1
-ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:9610 size:1075 flags:0
+ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:9610 size:1084 flags:0
ret: 0 st: 0 ts:-0.905000 flags:0
-ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:9610 size:1075 flags:0
+ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:9610 size:1084 flags:0
ret: 0 st: 0 ts:1.989000 flags:1
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:130821 size:1905 flags:0
+ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:130821 size:1914 flags:0
ret: 0 st:-1 ts:0.883340 flags:0
-ret: 0 st: 0 dts:1.000000 pts:1.000000 pos:63237 size:1648 flags:0
+ret: 0 st: 0 dts:1.000000 pts:1.000000 pos:63237 size:1657 flags:0
ret: 0 st:-1 ts:-0.222493 flags:1
-ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:9610 size:1075 flags:0
+ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:9610 size:1084 flags:0
ret: 0 st: 0 ts:2.672000 flags:0
-ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:130821 size:1905 flags:0
+ret: 0 st: 0 dts:1.960000 pts:1.960000 pos:130821 size:1914 flags:0
ret: 0 st: 0 ts:1.566000 flags:1
-ret: 0 st: 0 dts:1.480000 pts:1.480000 pos:95674 size:1891 flags:0
+ret: 0 st: 0 dts:1.480000 pts:1.480000 pos:95674 size:1900 flags:0
ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.520000 pts:0.520000 pos:35101 size:1438 flags:0
+ret: 0 st: 0 dts:0.520000 pts:0.520000 pos:35101 size:1447 flags:0
ret: 0 st:-1 ts:-0.645825 flags:1
-ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:9610 size:1075 flags:0
+ret: 0 st: 0 dts:0.040000 pts:0.040000 pos:9610 size:1084 flags:0
----------------
tests/data/a-snow.avi
ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:5660 size:2987 flags:1
@@ -3216,7 +3216,7 @@ ret:-1 st:-1 ts:0.460008 flags:0
ret:-1 st:-1 ts:-0.645825 flags:1
----------------
tests/data/b-libav.rm
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:394 size:31384 flags:1
+ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:394 size:31393 flags:1
ret: 0 st:-1 ts:-1.000000 flags:0
ret: 0 st: 1 dts:0.000000 pts:0.000000 pos:31790 size:278 flags:1
ret: 0 st:-1 ts:1.894167 flags:1