[FFmpeg-devel] [PATCH 1/3] avformat/matroskaenc: Don't use stream side-data size

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Fri May 22 06:39:08 EEST 2020


James Almer:
> On 5/21/2020 10:24 PM, Andreas Rheinhardt wrote:
>> av_stream_get_side_data() tells the caller whether a stream has side
>> data of a specific type; if present it can also tell the caller the size
>> of the side data via an optional argument. The Matroska muxer always
>> used this optional argument, although it doesn't really need the size,
>> as the relevant side-data are not buffers, but structures. So change
>> this.
>>
>> Furthermore, relying on the size also made the code susceptible to
>> a quirk of av_stream_get_side_data(): It only sets the size argument if
>> it found side data of the desired type.
> 
> Sounds like something that should be fixed instead.
> av_packet_get_side_data() sets the size argument to 0 if it doesn't find
> the requested side data type. This function should do the same.
> 
The third patch [1] in this patchset does exactly this.

- Andreas

[1]: https://ffmpeg.org/pipermail/ffmpeg-devel/2020-May/263088.html


More information about the ffmpeg-devel mailing list