/src/vlc/modules/demux/mpeg/timestamps.h
Line | Count | Source (jump to first uncovered line) |
1 | | /***************************************************************************** |
2 | | * timestamps.h: MPEG TS/PS Timestamps helpers |
3 | | ***************************************************************************** |
4 | | * Copyright (C) 2004-2016 VLC authors and VideoLAN |
5 | | * |
6 | | * This program is free software; you can redistribute it and/or modify it |
7 | | * under the terms of the GNU Lesser General Public License as published by |
8 | | * the Free Software Foundation; either version 2.1 of the License, or |
9 | | * (at your option) any later version. |
10 | | * |
11 | | * This program is distributed in the hope that it will be useful, |
12 | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | | * GNU Lesser General Public License for more details. |
15 | | * |
16 | | * You should have received a copy of the GNU General Public License |
17 | | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | | *****************************************************************************/ |
19 | | #ifndef VLC_MPEG_TIMESTAMPS_H |
20 | | #define VLC_MPEG_TIMESTAMPS_H |
21 | | |
22 | 9.88k | #define FROM_SCALE_NZ(x) ((vlc_tick_t)((x) * 100 / 9)) |
23 | | #define TO_SCALE_NZ(x) ((x) * 9 / 100) |
24 | | |
25 | 9.88k | #define FROM_SCALE(x) (VLC_TICK_0 + FROM_SCALE_NZ(x)) |
26 | | #define TO_SCALE(x) TO_SCALE_NZ((x) - VLC_TICK_0) |
27 | | |
28 | | typedef int64_t stime_t; |
29 | | |
30 | | static inline stime_t TimeStampWrapAround( stime_t i_first_pcr, stime_t i_time ) |
31 | 0 | { |
32 | 0 | stime_t i_adjust = 0; |
33 | 0 | if( i_first_pcr > 0x0FFFFFFFF && i_time < 0x0FFFFFFFF ) |
34 | 0 | i_adjust = 0x1FFFFFFFF; |
35 | 0 |
|
36 | 0 | return i_time + i_adjust; |
37 | 0 | } Unexecuted instantiation: ps.c:TimeStampWrapAround Unexecuted instantiation: pva.c:TimeStampWrapAround Unexecuted instantiation: ty.c:TimeStampWrapAround Unexecuted instantiation: cvdsub.c:TimeStampWrapAround Unexecuted instantiation: svcdsub.c:TimeStampWrapAround Unexecuted instantiation: textst.c:TimeStampWrapAround |
38 | | |
39 | | #endif |