aboutsummaryrefslogtreecommitdiffstats
path: root/examples/alffplay.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/alffplay.cpp')
-rw-r--r--examples/alffplay.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/examples/alffplay.cpp b/examples/alffplay.cpp
index 7a4b7aac..890ecedb 100644
--- a/examples/alffplay.cpp
+++ b/examples/alffplay.cpp
@@ -285,7 +285,7 @@ struct AudioState {
AVStream *mStream{nullptr};
AVCodecCtxPtr mCodecCtx;
- DataQueue<2*1024*1024> mQueue;
+ DataQueue<size_t{2}*1024*1024> mQueue;
/* Used for clock difference average computation */
seconds_d64 mClockDiffAvg{0};
@@ -372,7 +372,7 @@ struct VideoState {
AVStream *mStream{nullptr};
AVCodecCtxPtr mCodecCtx;
- DataQueue<14*1024*1024> mQueue;
+ DataQueue<size_t{14}*1024*1024> mQueue;
/* The pts of the currently displayed frame, and the time (av_gettime) it
* was last updated - used to have running video pts
@@ -738,8 +738,8 @@ bool AudioState::readAudio(uint8_t *samples, unsigned int length, int &sample_sk
{
const auto len = static_cast<unsigned int>(mSamplesLen - mSamplesPos);
if(rem > len) rem = len;
- std::copy_n(mSamples + static_cast<unsigned int>(mSamplesPos)*mFrameSize,
- rem*mFrameSize, samples);
+ std::copy_n(mSamples + static_cast<unsigned int>(mSamplesPos)*size_t{mFrameSize},
+ rem*size_t{mFrameSize}, samples);
}
else
{
@@ -751,7 +751,7 @@ bool AudioState::readAudio(uint8_t *samples, unsigned int length, int &sample_sk
mSamplesPos += static_cast<int>(rem);
mCurrentPts += nanoseconds{seconds{rem}} / mCodecCtx->sample_rate;
- samples += rem*mFrameSize;
+ samples += rem*size_t{mFrameSize};
audio_size += rem;
while(mSamplesPos >= mSamplesLen)
@@ -1165,7 +1165,7 @@ int AudioState::handler()
* ordering and normalization, so a custom matrix is needed to
* scale and reorder the source from AmbiX.
*/
- std::vector<double> mtx(64*64, 0.0);
+ std::vector<double> mtx(size_t{64}*64, 0.0);
mtx[0 + 0*64] = std::sqrt(0.5);
mtx[3 + 1*64] = 1.0;
mtx[1 + 2*64] = 1.0;
@@ -1546,8 +1546,8 @@ void VideoState::updateVideo(SDL_Window *screen, SDL_Renderer *renderer, bool re
/* point pict at the queue */
std::array<uint8_t*,3> pict_data;
pict_data[0] = static_cast<uint8_t*>(pixels);
- pict_data[1] = pict_data[0] + w*h;
- pict_data[2] = pict_data[1] + w*h/4;
+ pict_data[1] = pict_data[0] + ptrdiff_t{w}*h;
+ pict_data[2] = pict_data[1] + ptrdiff_t{w}*h/4;
std::array pict_linesize{pitch, pitch/2, pitch/2};