<div dir="ltr"><div class="gmail_extra">Carl and Mirko,</div><div class="gmail_extra"><br></div><div class="gmail_extra">Thank you for your replies. I resolved the problem by allocating in_stream->side_data->data </div><div class="gmail_extra"><br></div><div class="gmail_extra">
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">       </span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,128,0)">if</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">av_stream_get_side_data</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">in_stream</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">AV_PKT_DATA_DISPLAYMATRIX</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">sd_size</span><span style="color:rgb(0,0,0)">)!=</span><span style="color:rgb(0,0,128)">NULL</span><span style="color:rgb(0,0,0)">){</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">                </span><span style="color:rgb(128,0,128)">uint8_t</span><span style="color:rgb(0,0,0)">*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">resp</span><span style="color:rgb(0,0,0)">=(</span><span style="color:rgb(128,0,128)">uint8_t</span><span style="color:rgb(0,0,0)">*)</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">av_mallocz</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">in_stream</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(128,0,0)">side_data</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(128,0,0)">size</span><span style="color:rgb(0,0,0)">+</span><span style="font-family:arial,sans-serif;color:rgb(0,0,128)">AV_INPUT_BUFFER_MIN_SIZE</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px">                <span style="font-family:arial,sans-serif;color:rgb(0,0,0)">resp</span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)">  </span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">=</span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">av_stream_get_side_data</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">(</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">in_stream</span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">,</span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(128,0,128)">AV_PKT_DATA_DISPLAYMATRIX</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">,</span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">sd_size</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">);</span><br></pre><pre style="margin-top:0px;margin-bottom:0px">                <span style="font-family:arial,sans-serif;color:rgb(0,0,0)">in_stream</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">-></span><span style="font-family:arial,sans-serif;color:rgb(128,0,0)">side_data</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">-></span><span style="font-family:arial,sans-serif;color:rgb(128,0,0)">data</span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">=</span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">(</span><span style="font-family:arial,sans-serif;color:rgb(128,0,128)">uint8_t</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">*)</span><span style="font-family:arial,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">av_mallocz</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">(</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">                              </span><span style="color:rgb(0,0,0)">in_stream</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(128,0,0)">side_data</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(128,0,0)">size</span><span style="color:rgb(0,0,0)">*</span><span style="color:rgb(128,128,0)">sizeof</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(128,0,128)">uint8_t</span><span style="color:rgb(0,0,0)">*)</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">                              </span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">                av_stream_add_side_data</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">out_stream</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">AV_PKT_DATA_DISPLAYMATRIX</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">resp</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">*</span><span style="color:rgb(0,0,0)">sd_size</span><span style="color:rgb(0,0,0)">);</span></pre></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">                  </span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(0,0,0)">}</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(0,0,0)">}</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">> </span>For real errors as in this case, recompiling and hoping that the</pre><span style="font-size:12.8px">> output is helpful seems much more difficult than running a</span><br style="font-size:12.8px"><span style="font-size:12.8px">> simulator that is known to cover exactly these cases.</span></div><div class="gmail_extra"><span style="font-size:12.8px"><br></span></div><div class="gmail_extra"><span style="font-size:12.8px">You were right Carl. </span></div><div class="gmail_extra"><span style="font-size:12.8px"><br></span></div><div class="gmail_extra"><span style="font-size:12.8px">Regards,</span></div><div class="gmail_extra"><span style="font-size:12.8px">Davood Falahati</span></div></div>