On Tue, 24 Feb 2015, Luca Barbato wrote:
On 24/02/15 17:35, Martin Storsjö wrote:
This is different from how it is handled in codecs/demuxers/muxers
though (where the close function isn't called if the open function
failed), but since the number of depacketizers that have an .init
function is quite limited, this is easy to change.
The main point is that if the init function failed, we shouldn't
try to use that depacketizer at all - this makes sure that the
parse function doesn't need to check for the things that were
initialized in the init function.
---
libavformat/rdt.c | 3 ---
libavformat/rtpdec.h | 2 +-
libavformat/rtpdec_mpegts.c | 3 ---
libavformat/rtsp.c | 30 ++++++++++++++++++++++--------
4 files changed, 23 insertions(+), 15 deletions(-)
Ok, we probably should make the same for the codec/demuxer/muxer/etc.
Yes, possibly, but that's much harder to do (here it's only a handful of
depacketizers). The main point here wasn't so much that we call free or
not, but just to actually check the return value of init at all, which we
didn't do before.
// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel