projects
/
platform
/
upstream
/
libav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
97d19c2
)
alsa-audio-dec: explicitly cast the delay to a signed int64
author
Anton Khirnov
<anton@khirnov.net>
Sun, 1 Dec 2013 08:27:01 +0000
(09:27 +0100)
committer
Anton Khirnov
<anton@khirnov.net>
Tue, 3 Dec 2013 11:04:26 +0000
(12:04 +0100)
Otherwise the expression will be evaluated as unsigned, which will break
when the result should be negative.
CC:libav-stable@libav.org
libavdevice/alsa-audio-dec.c
patch
|
blob
|
history
diff --git
a/libavdevice/alsa-audio-dec.c
b/libavdevice/alsa-audio-dec.c
index 5b32ed980c6b5fe07fd8529a0ef0a1573ea5cffb..0687a4ad3dae1c5801749267c368e78844633531 100644
(file)
--- a/
libavdevice/alsa-audio-dec.c
+++ b/
libavdevice/alsa-audio-dec.c
@@
-142,7
+142,7
@@
static int audio_read_packet(AVFormatContext *s1, AVPacket *pkt)
ts_delay += res;
pkt->pts = timestamp.tv_sec * 1000000LL
+ (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);
pkt->size = res * s->frame_size;