Skip to content

Commit

Permalink
Fix cast
Browse files Browse the repository at this point in the history
  • Loading branch information
jcdr428 committed Aug 10, 2023
1 parent fc9b952 commit d39559b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tsMuxer/ioContextDemuxer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ using namespace std;
#endif
/////////////////////////////////////

double av_int2dbl(const int64_t v)
double av_int2dbl(const uint64_t v)
{
if (v + v > 0xFFEULL << 52)
return 0; // 0.0/0.0;
return ldexp(static_cast<double>((v & ((1LL << 52) - 1)) + (1LL << 52)) * (v >> 63 | 1), (v >> 52 & 0x7FF) - 1075);
}

float av_int2flt(const int32_t v)
float av_int2flt(const uint32_t v)
{
if (v + v > 0xFF000000U)
return 0; // 0.0/0.0;
Expand Down
4 changes: 2 additions & 2 deletions tsMuxer/ioContextDemuxer.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ enum class IOContextTrackType
DATA = 0x40
};

double av_int2dbl(int64_t v);
float av_int2flt(int32_t v);
double av_int2dbl(uint64_t v);
float av_int2flt(uint32_t v);

struct Track
{
Expand Down

0 comments on commit d39559b

Please sign in to comment.