[xiph-commits] r15981 - trunk/ffmpeg2theora/src
j at svn.xiph.org
j at svn.xiph.org
Tue May 5 05:40:49 PDT 2009
Author: j
Date: 2009-05-05 05:40:48 -0700 (Tue, 05 May 2009)
New Revision: 15981
Modified:
trunk/ffmpeg2theora/src/ffmpeg2theora.c
Log:
frames off by one, dont write audio after eos page has been written
Modified: trunk/ffmpeg2theora/src/ffmpeg2theora.c
===================================================================
--- trunk/ffmpeg2theora/src/ffmpeg2theora.c 2009-05-04 23:07:59 UTC (rev 15980)
+++ trunk/ffmpeg2theora/src/ffmpeg2theora.c 2009-05-05 12:40:48 UTC (rev 15981)
@@ -1000,7 +1000,7 @@
}
/*check for end time and calculate number of frames to encode*/
- no_frames = this->fps*(this->end_time - this->start_time);
+ no_frames = this->fps*(this->end_time - this->start_time) - 1;
no_samples = this->sample_rate * (this->end_time - this->start_time);
if ((info.audio_only && this->end_time > 0 && no_samples <= 0)
|| (!info.audio_only && this->end_time > 0 && no_frames <= 0)) {
@@ -1189,7 +1189,7 @@
if ((audio_eos && !audio_done) || (ret >= 0 && pkt.stream_index == this->audio_index)) {
this->pts_offset = (double) pkt.pts / AV_TIME_BASE -
(double) this->sample_count / this->sample_rate;
- while(audio_eos || len > 0 ) {
+ while((audio_eos && !audio_done) || len > 0 ) {
int samples=0;
int samples_out=0;
int data_size = 4*AVCODEC_MAX_AUDIO_FRAME_SIZE;
More information about the commits
mailing list