Commit d2471f84 authored by brendan's avatar brendan
Browse files

Karl's patch. In his words: "looks like the theora part is missing the

initial setting for theora streams, on files it's generally ok the
absolute beginning is typically 0 but for streams that often isn't the
case."

Don't know exactly what that means but I trust him, and he wrote this
file anyway.

svn path=/icecast/trunk/libshout/; revision=9900
parent d473f887
......@@ -99,12 +99,16 @@ static int read_theora_page(ogg_codec_t *codec, ogg_page *page)
iframe = granulepos >> theora_data->granule_shift;
pframe = granulepos - (iframe << theora_data->granule_shift);
frames = iframe + pframe;
new_time = (frames * per_frame);
duration = new_time - theora_data->prev_time;
theora_data->prev_time = new_time;
codec->senttime += (uint64_t)(duration + 0.5);
if (theora_data->prev_time == 0)
theora_data->prev_time = (frames - ogg_page_packets(page))*per_frame;
else
{
new_time = (frames * per_frame);
duration = new_time - theora_data->prev_time;
theora_data->prev_time = new_time;
codec->senttime += (uint64_t)(duration + 0.5);
}
}
return SHOUTERR_SUCCESS;
......
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