<div class="gmail_quote">2009/9/16 Steven Walters <span dir="ltr"><<a href="mailto:kemuri9@gmail.com">kemuri9@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Wed, Sep 16, 2009 at 4:43 AM, Alessandro Ferrari<br>
<<a href="mailto:alessandroferrari87@gmail.com">alessandroferrari87@gmail.com</a>> wrote:<br>
> Hi,<br>
> i'm developing a program using x264 api starting by the source code of<br>
> x264.c, and I encurr in a problem that probably i miss any operations. I<br>
> need to minimize the frame delay, so for this reason initially i have<br>
> developed forcing using only one thread. The program in this case works<br>
> correctly. Then, for maximize the performance i simply set the i_threads=2<br>
> to enabling multi-threading, and I expect a frame delay of one frame, but<br>
> the result is very different. I test the encoder on a sequence of 100<br>
> frames, and for all 100 frames the encoder function return a zero value for<br>
> i_nal, at the end in the flush _delayed_frame loop i have again 2 encoder<br>
> function calling with i_nal null, and then at the third passing i have<br>
> i_nal=1 but i have this error:<br>
> test_x264_2thread: common/frame.c:971: x264_frame_push_unused: Assertion<br>
> `frame->i_reference_count > 0' failed.<br>
> The strange things is that with param.i_threads=1 always works without<br>
> problem.<br>
> If i force the settings of x264.c by specifying it before calling the<br>
> encoder function to be equal at the settings that i specify in my program i<br>
> haven't this error. What could be the problem?<br>
> I also include my encoding functions:<br>
><br>
</div><div class="im">> Thanks for the attention.<br>
> Best regards.<br>
><br>
<br>
</div>with threads >1, the lookahead thread is enabled by default as well<br>
which adds more delay itself.<br>
It does not seem you are compensating for this in your logic so try<br>
disabling it by adding a<br>
param.i_sync_lookahead = 0;<br>
line in your section where you modify the parameters.<br></blockquote></div> <br>Thanks, but i haven't this field in my version of x264, i have download around a month ago, probably it's added very recently. The lookahead thread is activated by default also in x264 version pre i_sync_lookahead? thanks.<br>