[vlc-devel] [vlc-commits] demux: ts: check defined reference

Steve Lhomme robux4 at ycbcr.xyz
Mon Sep 17 17:49:19 CEST 2018


BTW this is checking values against VLC_TICK whereas TS_TICK_UNKNOWN and 
SETANDVALID() deals with stime_t which (as the name doesn't suggest) is 
an MPEG clock running at 90 kHz. vlc_tick cannot be converted back and 
forth directly.


On 10/09/2018 13:13, Steve Lhomme wrote:
> Why do we need this very narrow limitation ? In the future 
> VLC_TICK_INVALID will be a very large value unrelated to VLC_TICK_0.
>
>
> On 07/09/2018 18:01, Francois Cartegnie wrote:
>> vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri 
>> Sep  7 11:43:19 2018 +0200| 
>> [2d82539e5fd7a1db127ed30a12dd8039246833da] | committer: Francois 
>> Cartegnie
>>
>> demux: ts: check defined reference
>>
>> fail if invalid reference changes
>>
>>> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2d82539e5fd7a1db127ed30a12dd8039246833da 
>>>
>> ---
>>
>>   modules/demux/mpeg/ts.h | 7 ++++++-
>>   1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/modules/demux/mpeg/ts.h b/modules/demux/mpeg/ts.h
>> index b12a7dac51..24ed821bd0 100644
>> --- a/modules/demux/mpeg/ts.h
>> +++ b/modules/demux/mpeg/ts.h
>> @@ -28,7 +28,12 @@ typedef struct csa_t csa_t;
>>   #define TS_USER_PMT_NUMBER (0)
>>     #define TS_PSI_PAT_PID 0x00
>> -#define TS_TICK_UNKNOWN -1
>> +
>> +#if (VLC_TICK_INVALID + 1 != VLC_TICK_0)
>> +#   error "can't define TS_UNKNOWN reference"
>> +#else
>> +#   define TS_TICK_UNKNOWN (VLC_TICK_INVALID - 1)
>> +#endif
>>   #define SETANDVALID(a) (a != TS_TICK_UNKNOWN && a != VLC_TICK_INVALID)
>>     typedef enum ts_standards_e
>>
>> _______________________________________________
>> vlc-commits mailing list
>> vlc-commits at videolan.org
>> https://mailman.videolan.org/listinfo/vlc-commits
>



More information about the vlc-devel mailing list