[Bug 767383] Critical error gst_buffer_map_range: assertion 'GST_IS_BUFFER (buffer)' failed with gst-validate

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Mon Jun 13 09:06:56 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=767383

--- Comment #7 from yvonne.chen <1992184780 at qq.com> ---
from the log , I still can not locate the problem. I also expect this  to be
related to my plugin, but I see nothing related to my plugin from the log.
Following may be the related codes. Could you help me to check it? especially
the buffer related? 
====================part 1============== 
if (gst_structure_has_field(structure, "streamheader")) {
         headers = gst_structure_get_value (structure, "streamheader");
        if (headers == NULL || !GST_VALUE_HOLDS_ARRAY (headers)) {
            GST_WARNING ( "no 'streamheader' field in input caps,\n");
            return FALSE;
        }
        num = gst_value_array_get_size (headers);
        GST_WARNING ( "num=%d\n",num);    
        for (i = 0; i < num; ++i) {
            const GValue *header_val;
            GstBuffer *header_buf;

            header_val = gst_value_array_get_value (headers, i);
            if (header_val == NULL || !GST_VALUE_HOLDS_BUFFER (header_val))
            return FALSE;
       if(i==0){
          info->configdata =                   
gst_buffer_make_writable(gst_value_get_buffer(header_val));
                  if(pcodec->audio_type == AFORMAT_VORBIS)
                     pcodec->audio_info.extradata[1] = gst_buffer_get_size
(info->configdata );
              } else {
                  header_buf = g_value_dup_boxed (header_val);
                 if(pcodec->audio_type ==AFORMAT_VORBIS && i==1)
                    pcodec->audio_info.extradata[2] = gst_buffer_get_size
(header_buf);
                GST_WARNING ("pushing header buffer of %" G_GSIZE_FORMAT "
bytes "
              " into adapter", gst_buffer_get_size (header_buf));
                 if(header_buf)
                
gst_buffer_copy_into(info->configdata,header_buf,GST_BUFFER_COPY_MEMORY,0,-1);  
               }
          } 
    }


=================part2========================================
gint vorbis_writeheader(AmlStreamInfo* info, codec_para_t *pcodec)
{
    GstMapInfo map;
    if(info->configdata){
        gst_buffer_map(info->configdata, &map, GST_MAP_READ);
        pcodec->audio_info.extradata_size = map.size;
       GST_WARNING("size=%d\n",pcodec->audio_info.extradata_size);
        if (pcodec->audio_info.extradata_size > 0) {
            if (pcodec->audio_info.extradata_size >  AUDIO_EXTRA_DATA_SIZE) {
                GST_WARNING("[%s:%d],extra data size exceed max  extra data
buffer,cut it to max buffer size ", __FUNCTION__, __LINE__);
                pcodec->audio_info.extradata_size =  AUDIO_EXTRA_DATA_SIZE;
            }
         pcodec->audio_info.extradata[0] = 0x02;
            memcpy((char*)pcodec->audio_info.extradata+3, map.data,
pcodec->audio_info.extradata_size);
        }
        gst_buffer_unmap(info->configdata, &map);
    }
    pcodec->audio_info.extradata_size= pcodec->audio_info.extradata_size +3;
    pcodec->audio_info.valid = 1;
    return 0;    
}
gint vorbis_startcode(AmlStreamInfo* info, codec_para_t *pcodec, GstBuffer
*buffer)
{
    gint32 buf_size;
    char head[] = "HEAD";

    codec_write(pcodec, head, 4);
    buf_size = gst_buffer_get_size(buffer);
    codec_write(pcodec, &buf_size, 4);

    return 0;

}

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list