[FFmpeg-devel] [RFC] [PATCH] ffmpeg: fix streamcopy with side data

Christophe Gisquet christophe.gisquet at gmail.com
Thu Aug 14 12:24:47 CEST 2014


Hi,

the attached patch seems to fix ticket #3773, but streamcopy is such a
core feature of ffmpeg that I assume I'm missing a use case or
incorrectly handle the buffers referencing.

Another note is that this patch was developed without a memory tracer
like valgrind: I have just validated that the test case doesn't crash
and passes fate-h264-bsf-mp4toannexb.

Last point, I think this bug raises a few questions/issues:
- API may not be abundantly clear that AVPacket::data is refcounted
and should not be meddled with directly;
- For lack of a way to do it, ffmpeg.c streamcopy meddles with AVPacket::data;
- AVPacket::side_data is not ref-counted; because of such things as
av_format_inject_global_side_data, it could make sense to have it
separate from AVPacket::data ref-counting.

That last point is probably a major, API-breaking, undertaking. I have
no plan to start on it, in particular because I feel unqualified for
it.

Best regards,
-- 
Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ffmpeg-fix-streamcopy-with-side-data.patch
Type: text/x-patch
Size: 1355 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140814/80f2902f/attachment.bin>


More information about the ffmpeg-devel mailing list