aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Sommer <saschasommer@freenet.de>2009-09-16 12:45:24 +0000
committerSascha Sommer <saschasommer@freenet.de>2009-09-16 12:45:24 +0000
commit9d66ef18fa5504b073067691ed906bc15cfc9c87 (patch)
tree5cf60df09f19bd2fed3a29c2f4284ef81ab77f95
parent5f14b5659383f70bb0f03266d551e394136dd1d6 (diff)
downloadffmpeg-9d66ef18fa5504b073067691ed906bc15cfc9c87.tar.gz
fix PTS calculation for audio formats with bits per sample != 16
Originally committed as revision 19880 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--ffmpeg.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 72546d873a..944fec3a2f 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1257,6 +1257,7 @@ static int output_packet(AVInputStream *ist, int ist_index,
AVSubtitle subtitle, *subtitle_to_free;
int got_subtitle;
AVPacket avpkt;
+ int bps = av_get_bits_per_sample_format(ist->st->codec->sample_fmt)>>3;
if(ist->next_pts == AV_NOPTS_VALUE)
ist->next_pts= ist->pts;
@@ -1310,7 +1311,7 @@ static int output_packet(AVInputStream *ist, int ist_index,
continue;
}
data_buf = (uint8_t *)samples;
- ist->next_pts += ((int64_t)AV_TIME_BASE/2 * data_size) /
+ ist->next_pts += ((int64_t)AV_TIME_BASE/bps * data_size) /
(ist->st->codec->sample_rate * ist->st->codec->channels);
break;}
case CODEC_TYPE_VIDEO: