[FFmpeg-cvslog] lavf: Don't drop both pts and dts if timestamps are invalid

Michael Niedermayer git at videolan.org
Sun Oct 12 01:03:54 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Nov 16 01:19:35 2011 +0100| [bd239c9a2e151c0aeeb653a571f130aae7320894] | committer: Martin Storsjö

lavf: Don't drop both pts and dts if timestamps are invalid

In these cases, only drop dts. Because if we drop both we have no
timestamps at all for some files.

This improves playback of HLS streams from GoPro cameras.

Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bd239c9a2e151c0aeeb653a571f130aae7320894
---

 libavformat/utils.c    |    2 +-
 tests/ref/fate/vc1-ism |  182 +++++++++++++++++-------------------------------
 2 files changed, 63 insertions(+), 121 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 8757c10..ffad92f 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -616,7 +616,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
     if (delay == 1 && pkt->dts == pkt->pts &&
         pkt->dts != AV_NOPTS_VALUE && presentation_delayed) {
         av_log(s, AV_LOG_DEBUG, "invalid dts/pts combination\n");
-        pkt->dts = pkt->pts = AV_NOPTS_VALUE;
+        pkt->dts = AV_NOPTS_VALUE;
     }
 
     if (pkt->duration == 0 && st->codec->codec_type != AVMEDIA_TYPE_AUDIO) {
diff --git a/tests/ref/fate/vc1-ism b/tests/ref/fate/vc1-ism
index 4daca95..a60cb8a 100644
--- a/tests/ref/fate/vc1-ism
+++ b/tests/ref/fate/vc1-ism
@@ -1,121 +1,63 @@
 #tb 0: 1/10000000
-0,     423334,     423334,        0,    37440, 0xd1bc5235
-0,     840000,     840000,        0,    37440, 0x158e6167
-0,    1256666,    1256666,        0,    37440, 0x0faa4481
-0,    1670000,    1670000,        0,    37440, 0x427158c5
-0,    2086666,    2086666,        0,    37440, 0x4eb53ac6
-0,    2500000,    2500000,        0,    37440, 0x99304eea
-0,    2916666,    2916666,        0,    37440, 0xcc554a6f
-0,    3340000,    3340000,        0,    37440, 0xabeb6c35
-0,    3756666,    3756666,        0,    37440, 0xddfc7e18
-0,    4170000,    4170000,        0,    37440, 0xaa79b504
-0,    4586666,    4586666,        0,    37440, 0x5cb1c839
-0,    5000000,    5000000,        0,    37440, 0x7e36ecca
-0,    5416666,    5416666,        0,    37440, 0xf486f425
-0,    5840000,    5840000,        0,    37440, 0xf1b4138f
-0,    6256666,    6256666,        0,    37440, 0x966f1a49
-0,    6670000,    6670000,        0,    37440, 0x5eff21da
-0,    7086666,    7086666,        0,    37440, 0x333f39b1
-0,    7500000,    7500000,        0,    37440, 0x62e5963e
-0,    7916666,    7916666,        0,    37440, 0x26930671
-0,    8340000,    8340000,        0,    37440, 0x27b4bb6c
-0,    8756666,    8756666,        0,    37440, 0xdbd07766
-0,    9170000,    9170000,        0,    37440, 0x04260104
-0,    9586666,    9586666,        0,    37440, 0x9b1e078b
-0,   10000000,   10000000,        0,    37440, 0xdf4e2474
-0,   10416666,   10416666,        0,    37440, 0x57d44986
-0,   10840000,   10840000,        0,    37440, 0x8780e34c
-0,   11256666,   11256666,        0,    37440, 0xf80c8bc0
-0,   11670000,   11670000,        0,    37440, 0x630a7583
-0,   12086666,   12086666,        0,    37440, 0x235ae089
-0,   12500000,   12500000,        0,    37440, 0x984b8f0e
-0,   12916666,   12916666,        0,    37440, 0x865cf592
-0,   13340000,   13340000,        0,    37440, 0x70f376f2
-0,   13756666,   13756666,        0,    37440, 0x8b30c035
-0,   14170000,   14170000,        0,    37440, 0xde772d79
-0,   14586666,   14586666,        0,    37440, 0x8e076be5
-0,   15000000,   15000000,        0,    37440, 0x3dc2bd9f
-0,   15416666,   15416666,        0,    37440, 0xb782eb67
-0,   15840000,   15840000,        0,    37440, 0x02025d73
-0,   16256666,   16256666,        0,    37440, 0x86bbbce8
-0,   16670000,   16670000,        0,    37440, 0xd6554f62
-0,   17086666,   17086666,        0,    37440, 0xb831b917
-0,   17500000,   17500000,        0,    37440, 0x80643560
-0,   17916666,   17916666,        0,    37440, 0x4ecf9afd
-0,   18340000,   18340000,        0,    37440, 0x9ce51e0b
-0,   18756666,   18756666,        0,    37440, 0x179466cd
-0,   19170000,   19170000,        0,    37440, 0x145fc900
-0,   19586666,   19586666,        0,    37440, 0xb1b50402
-0,   20000000,   20000000,        0,    37440, 0x0a87552a
-0,   20416666,   20416666,        0,    37440, 0x8f53821d
-0,   20840000,   20840000,        0,    37440, 0x1c07c825
-0,   21256666,   21256666,        0,    37440, 0x49dde82f
-0,   21670000,   21670000,        0,    37440, 0xb1a32605
-0,   22086666,   22086666,        0,    37440, 0x410f3cd5
-0,   22500000,   22500000,        0,    37440, 0xff5e6696
-0,   22916666,   22916666,        0,    37440, 0x96f678c9
-0,   23340000,   23340000,        0,    37440, 0x6c9e9e68
-0,   23756666,   23756666,        0,    37440, 0x79a2a655
-0,   24170000,   24170000,        0,    37440, 0xf237bd6c
-0,   24586666,   24586666,        0,    37440, 0x4051b611
-0,   25000000,   25000000,        0,    37440, 0xc7ccc918
-0,   25416666,   25416666,        0,    37440, 0xbd02c122
-0,   25840000,   25840000,        0,    37440, 0xacb3c881
-0,   26256666,   26256666,        0,    37440, 0x2abdb940
-0,   26670000,   26670000,        0,    37440, 0x19d5be85
-0,   27086666,   27086666,        0,    37440, 0xfa5fb1ba
-0,   27503332,   27503332,        0,    37440, 0xdae7a7aa
-0,   27919998,   27919998,        0,    37440, 0x6b0f9f69
-0,   28340000,   28340000,        0,    37440, 0x353e8201
-0,   28756666,   28756666,        0,    37440, 0xa21443aa
-0,   29170000,   29170000,        0,    37440, 0x66c8d7e0
-0,   29586666,   29586666,        0,    37440, 0xc332068e
-0,   30000000,   30000000,        0,    37440, 0x71431b9b
-0,   30416666,   30416666,        0,    37440, 0x392f15cb
-0,   30840000,   30840000,        0,    37440, 0x95a146bb
-0,   31256666,   31256666,        0,    37440, 0x7c51740a
-0,   31670000,   31670000,        0,    37440, 0xa3bdd43c
-0,   32086666,   32086666,        0,    37440, 0xa079f965
-0,   32500000,   32500000,        0,    37440, 0xa95423ea
-0,   32916666,   32916666,        0,    37440, 0xd1bd2c67
-0,   33340000,   33340000,        0,    37440, 0x6cf82844
-0,   33756666,   33756666,        0,    37440, 0xd401e128
-0,   34170000,   34170000,        0,    37440, 0x1f7db118
-0,   34586666,   34586666,        0,    37440, 0x2e0a65a9
-0,   35000000,   35000000,        0,    37440, 0x321c1c40
-0,   35416666,   35416666,        0,    37440, 0x95b2a127
-0,   35840000,   35840000,        0,    37440, 0xa1471f4b
-0,   36256666,   36256666,        0,    37440, 0x29d148c0
-0,   36670000,   36670000,        0,    37440, 0x24c07107
-0,   37086666,   37086666,        0,    37440, 0x0ead678d
-0,   37500000,   37500000,        0,    37440, 0xd0ca6495
-0,   37916666,   37916666,        0,    37440, 0x08f935ef
-0,   38340000,   38340000,        0,    37440, 0xb5ec3c38
-0,   38756666,   38756666,        0,    37440, 0xce371628
-0,   39170000,   39170000,        0,    37440, 0x68170812
-0,   39586666,   39586666,        0,    37440, 0xe222699e
-0,   40000000,   40000000,        0,    37440, 0xd688706c
-0,   40416666,   40416666,        0,    37440, 0x81a033f9
-0,   40840000,   40840000,        0,    37440, 0x28bd0fbf
-0,   41256666,   41256666,        0,    37440, 0xe36db7b2
-0,   41670000,   41670000,        0,    37440, 0x30559121
-0,   42086666,   42086666,        0,    37440, 0xbf2b5fc8
-0,   42500000,   42500000,        0,    37440, 0x4b427672
-0,   42916666,   42916666,        0,    37440, 0x0544b0b4
-0,   43340000,   43340000,        0,    37440, 0x38a70b06
-0,   43756666,   43756666,        0,    37440, 0x4ed62607
-0,   44170000,   44170000,        0,    37440, 0x6efe8ea6
-0,   44586666,   44586666,        0,    37440, 0x81197e11
-0,   45000000,   45000000,        0,    37440, 0xf4060050
-0,   45416666,   45416666,        0,    37440, 0xaf205f13
-0,   45840000,   45840000,        0,    37440, 0x5fa21382
-0,   46256666,   46256666,        0,    37440, 0x8627ad05
-0,   46670000,   46670000,        0,    37440, 0xf7130133
-0,   47086666,   47086666,        0,    37440, 0x76dea7ba
-0,   47500000,   47500000,        0,    37440, 0x1dbae1be
-0,   47916666,   47916666,        0,    37440, 0x74a933f7
-0,   48340000,   48340000,        0,    37440, 0xbdcd41a3
-0,   48756666,   48756666,        0,    37440, 0xf0fe8c1c
-0,   49170000,   49170000,        0,    37440, 0xc0036222
-0,   49586666,   49586666,        0,    37440, 0x3058385c
-0,   49586667,   49586667,        0,    37440, 0x68141016
+0,          4,          4,        0,    37440, 0xd1bc5235
+0,    1256670,    1256670,        0,    37440, 0x158e6167
+0,    2086670,    2086670,        0,    37440, 0x427158c5
+0,    2916670,    2916670,        0,    37440, 0x99304eea
+0,    3756670,    3756670,        0,    37440, 0xabeb6c35
+0,    4586670,    4586670,        0,    37440, 0xaa79b504
+0,    5416670,    5416670,        0,    37440, 0x7e36ecca
+0,    6256670,    6256670,        0,    37440, 0xf1b4138f
+0,    7086670,    7086670,        0,    37440, 0x5eff21da
+0,    7916670,    7916670,        0,    37440, 0x62e5963e
+0,    8756670,    8756670,        0,    37440, 0x27b4bb6c
+0,    9586670,    9586670,        0,    37440, 0x04260104
+0,   10416670,   10416670,        0,    37440, 0xdf4e2474
+0,   11256670,   11256670,        0,    37440, 0x8780e34c
+0,   12086670,   12086670,        0,    37440, 0x630a7583
+0,   12916670,   12916670,        0,    37440, 0x984b8f0e
+0,   13756670,   13756670,        0,    37440, 0x70f376f2
+0,   14586670,   14586670,        0,    37440, 0xde772d79
+0,   15416670,   15416670,        0,    37440, 0x3dc2bd9f
+0,   16256670,   16256670,        0,    37440, 0x02025d73
+0,   17086670,   17086670,        0,    37440, 0xd6554f62
+0,   17916670,   17916670,        0,    37440, 0x80643560
+0,   18756670,   18756670,        0,    37440, 0x9ce51e0b
+0,   19586670,   19586670,        0,    37440, 0x145fc900
+0,   20416670,   20416670,        0,    37440, 0x0a87552a
+0,   21256670,   21256670,        0,    37440, 0x1c07c825
+0,   22086670,   22086670,        0,    37440, 0xb1a32605
+0,   22916670,   22916670,        0,    37440, 0xff5e6696
+0,   23756670,   23756670,        0,    37440, 0x6c9e9e68
+0,   24586670,   24586670,        0,    37440, 0xf237bd6c
+0,   25416670,   25416670,        0,    37440, 0xc7ccc918
+0,   26256670,   26256670,        0,    37440, 0xacb3c881
+0,   27086670,   27086670,        0,    37440, 0x19d5be85
+0,   27506670,   27506670,        0,    37440, 0xdae7a7aa
+0,   27916670,   27916670,        0,    37440, 0x6b0f9f69
+0,   28756670,   28756670,        0,    37440, 0x353e8201
+0,   29586670,   29586670,        0,    37440, 0x66c8d7e0
+0,   30416670,   30416670,        0,    37440, 0x71431b9b
+0,   31256670,   31256670,        0,    37440, 0x95a146bb
+0,   32086670,   32086670,        0,    37440, 0xa3bdd43c
+0,   32916670,   32916670,        0,    37440, 0xa95423ea
+0,   33756670,   33756670,        0,    37440, 0x6cf82844
+0,   34586670,   34586670,        0,    37440, 0x1f7db118
+0,   35416670,   35416670,        0,    37440, 0x321c1c40
+0,   36256670,   36256670,        0,    37440, 0xa1471f4b
+0,   37086670,   37086670,        0,    37440, 0x24c07107
+0,   37916670,   37916670,        0,    37440, 0xd0ca6495
+0,   38756670,   38756670,        0,    37440, 0xb5ec3c38
+0,   39586670,   39586670,        0,    37440, 0x68170812
+0,   40416670,   40416670,        0,    37440, 0xd688706c
+0,   41256670,   41256670,        0,    37440, 0x28bd0fbf
+0,   42086670,   42086670,        0,    37440, 0x30559121
+0,   42916670,   42916670,        0,    37440, 0x4b427672
+0,   43756670,   43756670,        0,    37440, 0x38a70b06
+0,   44586670,   44586670,        0,    37440, 0x6efe8ea6
+0,   45416670,   45416670,        0,    37440, 0xf4060050
+0,   46256670,   46256670,        0,    37440, 0x5fa21382
+0,   47086670,   47086670,        0,    37440, 0xf7130133
+0,   47916670,   47916670,        0,    37440, 0x1dbae1be
+0,   48756670,   48756670,        0,    37440, 0xbdcd41a3
+0,   49586670,   49586670,        0,    37440, 0xc0036222
+0,   50006670,   50006670,        0,    37440, 0x68141016



More information about the ffmpeg-cvslog mailing list