Commit 0f91c19c authored by Jan Gerber's avatar Jan Gerber
Browse files

try TH_ENCCTL_SET_DUP_COUNT but handle TH_EINVAL

parent 679ff291
......@@ -1413,14 +1413,12 @@ void ff2theora_output(ff2theora this) {
if (got_picture || video_eos) {
prepare_ycbcr_buffer(this, ycbcr, output_buffered);
if(dups>0) {
int _dups = dups;
/*
//this only works if dups is < keyint,
//this only works if dups < keyint,
//see http://theora.org/doc/libtheora-1.1/theoraenc_8h.html#a8bb9b05471c42a09f8684a2583b8a1df
th_encode_ctl(info.td,TH_ENCCTL_SET_DUP_COUNT,&_dups,sizeof(int));
*/
while(_dups--) {
oggmux_add_video(&info, ycbcr, video_eos);
if (th_encode_ctl(info.td,TH_ENCCTL_SET_DUP_COUNT,&dups,sizeof(int)) == TH_EINVAL) {
int _dups = dups;
while(_dups--)
oggmux_add_video(&info, ycbcr, video_eos);
}
}
oggmux_add_video(&info, ycbcr, video_eos);
......
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