alsa-audio-dec: explicitly cast the delay to a signed int64

Otherwise the expression will be evaluated as unsigned, which will break
when the result should be negative.
CC:libav-stable@libav.org
This commit is contained in:
Anton Khirnov 2013-12-01 09:27:01 +01:00
parent 97d19c2fec
commit 089fac77a6
1 changed files with 1 additions and 1 deletions

View File

@ -142,7 +142,7 @@ static int audio_read_packet(AVFormatContext *s1, AVPacket *pkt)
ts_delay += res; ts_delay += res;
pkt->pts = timestamp.tv_sec * 1000000LL pkt->pts = timestamp.tv_sec * 1000000LL
+ (timestamp.tv_nsec * st->codec->sample_rate + (timestamp.tv_nsec * st->codec->sample_rate
- ts_delay * 1000000000LL + st->codec->sample_rate * 500LL) - (int64_t)ts_delay * 1000000000LL + st->codec->sample_rate * 500LL)
/ (st->codec->sample_rate * 1000LL); / (st->codec->sample_rate * 1000LL);
pkt->size = res * s->frame_size; pkt->size = res * s->frame_size;