Commit 47cd3c88 authored by Andreas Rheinhardt's avatar Andreas Rheinhardt

avcodec/bsf: Restrict ff_bsf_get_packet_ref() return values to <= 0

Up until now the documentation of ff_bsf_get_packet_ref() allowed return
values >= 0 in case of success, whereas av_bsf_receive_packet() only
allows 0 on success. Given that for some bitstream filters the return
value of ff_bsf_get_packet_ref() is forwarded to the caller of
av_bsf_receive_packet() without any filtering, there would be a problem
if ff_bsf_get_packet_ref() actually returned values > 0. But it
currently doesn't and there is no reason why it should ever do so.
Therefore this commit aligns the return values of these functions by
restricting ff_bsf_get_packet_ref() to always returns 0 on success.
Reviewed-by: 's avatarJames Almer <jamrial@gmail.com>
Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
parent 345158ae
...@@ -35,7 +35,7 @@ int ff_bsf_get_packet(AVBSFContext *ctx, AVPacket **pkt); ...@@ -35,7 +35,7 @@ int ff_bsf_get_packet(AVBSFContext *ctx, AVPacket **pkt);
* @param ctx pointer to AVBSFContext of filter * @param ctx pointer to AVBSFContext of filter
* @param pkt pointer to packet to move reference to * @param pkt pointer to packet to move reference to
* *
* @return 0>= on success, negative AVERROR in case of failure * @return 0 on success, negative AVERROR in case of failure
*/ */
int ff_bsf_get_packet_ref(AVBSFContext *ctx, AVPacket *pkt); int ff_bsf_get_packet_ref(AVBSFContext *ctx, AVPacket *pkt);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment