Commit dccd01f6 authored by faust3's avatar faust3

fix PTS calculation for audio formats with bits per sample != 16

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19880 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 315ae11c
...@@ -1257,6 +1257,7 @@ static int output_packet(AVInputStream *ist, int ist_index, ...@@ -1257,6 +1257,7 @@ static int output_packet(AVInputStream *ist, int ist_index,
AVSubtitle subtitle, *subtitle_to_free; AVSubtitle subtitle, *subtitle_to_free;
int got_subtitle; int got_subtitle;
AVPacket avpkt; AVPacket avpkt;
int bps = av_get_bits_per_sample_format(ist->st->codec->sample_fmt)>>3;
if(ist->next_pts == AV_NOPTS_VALUE) if(ist->next_pts == AV_NOPTS_VALUE)
ist->next_pts= ist->pts; ist->next_pts= ist->pts;
...@@ -1310,7 +1311,7 @@ static int output_packet(AVInputStream *ist, int ist_index, ...@@ -1310,7 +1311,7 @@ static int output_packet(AVInputStream *ist, int ist_index,
continue; continue;
} }
data_buf = (uint8_t *)samples; 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); (ist->st->codec->sample_rate * ist->st->codec->channels);
break;} break;}
case CODEC_TYPE_VIDEO: case CODEC_TYPE_VIDEO:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment