1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-02-04 06:08:26 +02:00
FFmpeg/libavformat
Andreas Rheinhardt 2fccd8bfb9 avformat/utils: Fix confusing return value for ff_read_packet()
Currently, ff_read_packet() sometimes forwards the return value of
AVInputFormat.read_packet() (which should be zero on success, but isn't
for all demuxers) and sometimes it overwrites this with zero.
Furthermore, it uses two variables, one for the read_packet return value
and one for other errors, which is a bit confusing; it is also
unnecessary given that the documentation explicitly states that
ff_read_packet() never returns positive values. Returning a positive
value would lead to leaks with some callers (namely asfrtp_parse_packet
and estimate_timings_from_pts). So always return zero in case of
success.

(This behaviour stems from a time before av_read_packet sanitized
the return value of read_packet at all: It was added in commit
626004690c23c981f67228ea325dde3f35193988 and was unnecessary since
88b00723906f68b7563214c30333e48888dddf78.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-23 01:04:09 +01:00
..
2021-02-09 19:37:27 +01:00
2021-01-23 14:32:54 +01:00
2021-03-05 19:45:00 +02:00
2021-02-02 23:53:29 +01:00
2021-02-23 10:14:26 +01:00
2021-03-11 14:21:30 -05:00
2021-01-23 14:32:54 +01:00
2021-02-04 17:52:45 +01:00
2020-11-11 17:05:24 +01:00
2021-03-03 16:54:20 +01:00
2021-01-23 01:05:25 +01:00
2021-02-25 23:10:14 +01:00
2020-12-21 01:27:33 -05:00
2021-03-19 22:57:23 +01:00
2021-03-13 17:36:48 +01:00
2021-03-08 19:19:19 +01:00
2021-03-08 19:19:19 +01:00
2021-02-19 07:45:48 +01:00
2021-03-19 00:42:27 +01:00
2021-01-28 21:08:11 +01:00
2021-03-13 17:36:48 +01:00
2021-03-14 23:29:51 +01:00
2021-03-05 19:45:00 +02:00
2021-01-16 08:51:31 +08:00
2021-02-02 23:53:29 +01:00
2020-12-05 00:08:33 +01:00