diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2014-05-28 10:41:37 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2014-05-28 10:41:37 +0200 |
commit | 48bb92f2f78bbaaa5ea8628f3fabee3866056cce (patch) | |
tree | de6823a8a623f150d5533d1d4f1fcad9981da2f6 /src/iso11172-1.h | |
parent | 9e71296d22207988e0e3986591f95f6ea04dae75 (diff) |
Attempt to make multiplexer 64bit compatible.
Diffstat (limited to 'src/iso11172-1.h')
-rw-r--r-- | src/iso11172-1.h | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/iso11172-1.h b/src/iso11172-1.h index 09588d1..e1121ab 100644 --- a/src/iso11172-1.h +++ b/src/iso11172-1.h @@ -133,16 +133,16 @@ namespace ISO11172_1 { /** * SCR stands for System Clock Reference */ - inline unsigned int SCR(unsigned int previous_SCR, - unsigned int pack_header_size, - unsigned int packets_per_pack, - unsigned int packet_data_size, - unsigned int Rmux) + inline uint32_t SCR(uint32_t previous_SCR, + uint32_t pack_header_size, + uint32_t packets_per_pack, + uint32_t packet_data_size, + uint32_t Rmux) { // To prevent a crash when doing division. if(Rmux == 0) Rmux = 1; - return previous_SCR + (unsigned int)((double)(pack_header_size + - (packets_per_pack * packet_data_size)) * + return previous_SCR + (uint32_t)((double)(pack_header_size + + (packets_per_pack * packet_data_size)) * (double)CLOCK_90KHZ / (double)Rmux); } @@ -159,22 +159,22 @@ namespace ISO11172_1 { * ( 1 + ---------------------------------------------------------- ) * packet_data_size */ - inline unsigned int Rmux(unsigned int video_data_rate, - unsigned int audio_data_rate, - unsigned int packet_header_size, - unsigned int pack_header_size, - unsigned int packets_per_pack, - unsigned int packet_data_size) + inline uint32_t Rmux(uint32_t video_data_rate, + uint32_t audio_data_rate, + uint32_t packet_header_size, + uint32_t pack_header_size, + uint32_t packets_per_pack, + uint32_t packet_data_size) { // To prevent a crash when doing division. if(packets_per_pack == 0) packets_per_pack = 1; if(packet_data_size == 0) packet_data_size = 1; - return (unsigned int)( - ((double)video_data_rate + (double)audio_data_rate) * - (1.0 + ((double)packet_header_size + (double)pack_header_size / (double)packets_per_pack) - / (double)packet_data_size) - ); + return (uint32_t)( + ((double)video_data_rate + (double)audio_data_rate) * + (1.0 + ((double)packet_header_size + (double)pack_header_size / (double)packets_per_pack) + / (double)packet_data_size) + ); } |