[Libav-user] SIde data allocate space

Corey Taylor corey.taylor.fl at gmail.com
Sun Jan 14 00:52:23 EET 2018


What error do you see?

corey

On Thu, Jan 11, 2018 at 2:02 PM, Davood Falahati <falahati.davood at gmail.com>
wrote:

> Dear all,
>
> I read this description in avformat.h
>
> /**
>
>  * Wrap an existing array as stream side data.
>
>  *
>
>  * @param st stream
>
>  * @param type side information type
>
>  * @param data the side data array. It must be allocated with the av_malloc()
>
>  *             family of functions. The ownership of the data is transferred to
>
>  *             st.
>
>  * @param size side information size
>
>  * @return zero on success, a negative AVERROR code on failure. On failure,
>
>  *         the stream is unchanged and the data remains owned by the caller.
>
>  */
>
> int av_stream_add_side_data(AVStream *st, enum AVPacketSideDataType type,
>
>                             uint8_t *data, size_t size);
>
>
> I have two AVStream variables, say in_stream and out_stream.
>
> I want to copy in_stream side data to out_stream. As suggested in
>
> the comments, out_stream->side_data should be allocated with av_malloc() family of functions.
>
> I want to know how should I allocate *out_stream->side_data->data* ?
>
> When I try
>
> out_stream->side_data->data = (uint8_t*) av_mallocz(in_stream->side_data->size*sizeof(uint8_t*));
>
>
> it leads to an unexpected error. Can anyone suggest how should I allocate this?
>
>
> Regards,
>
> Davood Falahati
>
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20180113/00ca6147/attachment.html>


More information about the Libav-user mailing list