aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2012-01-22 12:41:12 +0100
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2012-01-28 21:59:01 +0100
commit0b378e8aa99e24f5d1b128abaaf1572542ce86f1 (patch)
tree21fd1d0ff8629339fb94f21fc62c6d6bbdcfce7d
parentf870fc2fb9ef1a753d44b8b1d1c267c10581831f (diff)
downloadffmpeg-0b378e8aa99e24f5d1b128abaaf1572542ce86f1.tar.gz
DFA: fix "skip frame" TSW1 encoding.
Previously the decoder would raise an error. The end result is the same, the time stamps only change because regression tests create time stamps incorrectly. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
-rw-r--r--libavcodec/dfa.c2
-rw-r--r--tests/ref/fate/dfa417
2 files changed, 11 insertions, 8 deletions
diff --git a/libavcodec/dfa.c b/libavcodec/dfa.c
index bce6260bf3..97c0954422 100644
--- a/libavcodec/dfa.c
+++ b/libavcodec/dfa.c
@@ -67,6 +67,8 @@ static int decode_tsw1(uint8_t *frame, int width, int height,
segments = bytestream_get_le32(&src);
offset = bytestream_get_le32(&src);
+ if (segments == 0 && offset == frame_end - frame)
+ return 0; // skip frame
if (frame_end - frame <= offset)
return -1;
frame += offset;
diff --git a/tests/ref/fate/dfa4 b/tests/ref/fate/dfa4
index fbf00b658c..b6d5ed9053 100644
--- a/tests/ref/fate/dfa4
+++ b/tests/ref/fate/dfa4
@@ -1,13 +1,14 @@
-0, 0, 921600, 0xd9e060e3
-0, 12780, 921600, 0x15e28dc7
-0, 25560, 921600, 0x78e8bfbc
-0, 38340, 921600, 0xe9407075
-0, 51120, 921600, 0xab818b8a
+0, 0, 921600, 0x00000000
+0, 12780, 921600, 0xd9e060e3
+0, 25560, 921600, 0x15e28dc7
+0, 38340, 921600, 0x78e8bfbc
+0, 51120, 921600, 0xe9407075
0, 63900, 921600, 0xab818b8a
0, 76680, 921600, 0xab818b8a
0, 89460, 921600, 0xab818b8a
0, 102240, 921600, 0xab818b8a
0, 115020, 921600, 0xab818b8a
-0, 127800, 921600, 0xad5ad11c
-0, 140580, 921600, 0xe6e50f8c
-0, 153360, 921600, 0x9f127099
+0, 127800, 921600, 0xab818b8a
+0, 140580, 921600, 0xad5ad11c
+0, 153360, 921600, 0xe6e50f8c
+0, 166140, 921600, 0x9f127099