[FFmpeg-cvslog] swscale: fix documentation of sws_scale_frame()

Niklas Haas git at videolan.org
Wed Dec 18 18:31:04 EET 2024


ffmpeg | branch: master | Niklas Haas <git at haasn.dev> | Tue Dec 17 13:57:08 2024 +0100| [e05a1bb87962f4ade57a2a9664356978a08485ce] | committer: Niklas Haas

swscale: fix documentation of sws_scale_frame()

Since its introduction, this function has claimed to return 0 on success, yet
never actually did so (until the introduction of the new graph based API). It
always returned the number of scaled lines, and continues to do so.

To avoid confusion, but also avoid regressing possible clients that relied on
the existing semantics, simply update the documentation to reflect the actual
behavior. Remain ambiguous about the exact interpretation of the return value
on account of the unfortunate difference in behavior between the legacy and
new scaling APIs.

Signed-off-by: Niklas Haas <git at haasn.dev>
Sponsored-by: Sovereign Tech Fund

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e05a1bb87962f4ade57a2a9664356978a08485ce
---

 libswscale/swscale.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libswscale/swscale.h b/libswscale/swscale.h
index fa3a0f01ab..2a559e12f5 100644
--- a/libswscale/swscale.h
+++ b/libswscale/swscale.h
@@ -338,7 +338,7 @@ int sws_is_noop(const AVFrame *dst, const AVFrame *src);
  *              may be references to input planes, rather than copies.
  * @param src   The source frame. If the data buffers are set to NULL, then
  *              this function behaves identically to `sws_frame_setup`.
- * @return 0 on success, a negative AVERROR code on failure.
+ * @return >= 0 on success, a negative AVERROR code on failure.
  */
 int sws_scale_frame(SwsContext *c, AVFrame *dst, const AVFrame *src);
 



More information about the ffmpeg-cvslog mailing list