Commit d374f9aa authored by Jan Gerber's avatar Jan Gerber
Browse files

fix encoding without setting end time

parent de516996
......@@ -1023,8 +1023,8 @@ void ff2theora_output(ff2theora this) {
}
/* check for end time */
if (info.audio_only && no_samples > 0) {
if (this->sample_count > no_samples) {
if (no_samples > 0) {
if (this->sample_count >= no_samples) {
break;
}
}
......@@ -1205,7 +1205,8 @@ void ff2theora_output(ff2theora this) {
audio_p = audio_buf;
}
}
if (this->sample_count + samples_out > no_samples) {
if (this->end_time > 0 && this->sample_count + samples_out > no_samples) {
e_o_s = 1;
samples_out = no_samples - this->sample_count;
if (samples_out <= 0) {
......
......@@ -515,10 +515,8 @@ void oggmux_add_audio (oggmux_info *info, int16_t * buffer, int bytes, int sampl
int i,j, count = 0;
float **vorbis_buffer;
if (bytes <= 0 && samples <= 0) {
/* end of audio stream */
if (e_o_s)
vorbis_analysis_wrote (&info->vd, 0);
if (e_o_s) {
vorbis_analysis_wrote (&info->vd, 0);
}
else{
vorbis_buffer = vorbis_analysis_buffer (&info->vd, samples);
......
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