Commit Graph

25 Commits

Author SHA1 Message Date
Andreas Rheinhardt 790f793844 avutil/common: Don't auto-include mem.h
There are lots of files that don't need it: The number of object
files that actually need it went down from 2011 to 884 here.

Keep it for external users in order to not cause breakages.

Also improve the other headers a bit while just at it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
Andreas Rheinhardt c1e439d7e9 avformat: Forward errors where possible
It is not uncommon to find code where the caller thinks to know better
what the return value should be than the callee. E.g. something like
"if (av_new_packet(pkt, size) < 0) return AVERROR(ENOMEM);". This commit
changes several instances of this to instead forward the actual error.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-12-12 19:25:33 +01:00
Carl Eugen Hoyos dc77e64f2d lavf/rtpdec*: Constify all RTPDynamicProtocolHandler.
Reviewed-by: Muhammad Faiz
2018-02-14 01:14:35 +01:00
Ganesh Ajjanagadde 3fb32ae2cf avformat/rtpdec_mpa_robust: change assignment to inequality test in conditional
In the spirit of commit 8199908fdf, likely
typo originally.

Found by enabling -Wparentheses on clang 3.7 and running a manual audit.
To the best of my knowledge, no such instances remain.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-11-17 16:30:15 -05:00
Hendrik Leppkes 7f5af80ba4 Merge commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457'
* commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457':
  avpacket: Replace av_free_packet with av_packet_unref

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-27 14:28:56 +01:00
Luca Barbato ce70f28a17 avpacket: Replace av_free_packet with av_packet_unref
`av_packet_unref` matches the AVFrame ref-counted API and can be used as
a drop in replacement.

Deprecate `av_free_packet`.
2015-10-26 18:00:55 +01:00
Michael Niedermayer 5dce723715 Merge commit '2a66a580678dd9401f4d95e01e0958ca51864b6f'
* commit '2a66a580678dd9401f4d95e01e0958ca51864b6f':
  rtpdec_mpa_robust: Fix incrementing split_pos

Conflicts:
	libavformat/rtpdec_mpa_robust.c

See: ebf1f512e9
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-04 11:31:55 +01:00
Martin Storsjö 2a66a58067 rtpdec_mpa_robust: Fix incrementing split_pos
This fixes an oversight in 96084251, in a refactoring done on top
of Gilles' original patch.

Pointed out by Gilles Chanteperdrix.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-03-04 09:34:14 +02:00
Gilles Chanteperdrix ebf1f512e9 avformat/rtpdec_mpa_robust: fix commit 96084251e5
Commit 96084251e5 introduced a change in
the parser implementation which broke it. Restore the original
implementation.

Signed-off-by: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-02 11:58:42 +01:00
Michael Niedermayer 3130e5be92 Merge commit 'd594dbecce5f3af7f80bbf5bb1b516d740b69ccd'
* commit 'd594dbecce5f3af7f80bbf5bb1b516d740b69ccd':
  rtpdec: Rename the free method to close

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-25 00:58:39 +01:00
Michael Niedermayer 7d9b06eb17 Merge commit '199fb40278146c5bb162990c66ad3cd561abc780'
* commit '199fb40278146c5bb162990c66ad3cd561abc780':
  rtpdec: Use ffio_free_dyn_buf

Conflicts:
	libavformat/rtpdec_latm.c
	libavformat/rtpdec_svq3.c
	libavformat/rtpdec_xiph.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-25 00:42:14 +01:00
Michael Niedermayer fa80b76b11 Merge commit 'bb4a310bb85f43e62240145a656b1e5285b14239'
* commit 'bb4a310bb85f43e62240145a656b1e5285b14239':
  rtpdec: Don't free the payload context in the .free function

Conflicts:
	libavformat/rtpdec_latm.c
	libavformat/rtpdec_mpeg4.c
	libavformat/rtpdec_mpegts.c
	libavformat/rtpdec_xiph.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-25 00:25:12 +01:00
Michael Niedermayer 99c76902cd Merge commit '88434f9725e7c9484dcbcf323566ae88a2904f32'
* commit '88434f9725e7c9484dcbcf323566ae88a2904f32':
  rtpdec: Remove unnecessary inline attributes

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-24 23:44:45 +01:00
Michael Niedermayer 3804d73e46 Merge commit '5d8cae45737bed6239bd6b6e0698802dbe1463c8'
* commit '5d8cae45737bed6239bd6b6e0698802dbe1463c8':
  rtpdec: Get rid of all trivial .alloc/.free functions

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-24 22:55:20 +01:00
Michael Niedermayer 11fb625858 Merge commit '2b982e92f42a6e661d90b12b6592cd13cae496d4'
* commit '2b982e92f42a6e661d90b12b6592cd13cae496d4':
  rtpdec: Set need_parsing via a handler field

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-24 22:34:08 +01:00
Michael Niedermayer 2bedcbf822 Merge commit 'b651c9139e1ab222d5aab9151dcd7d6e40e49885'
* commit 'b651c9139e1ab222d5aab9151dcd7d6e40e49885':
  rtpdec_mpa_robust: Move .enc_name to the start of the struct

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-24 22:26:42 +01:00
Martin Storsjö d594dbecce rtpdec: Rename the free method to close
Many of these functions were named foo_free_context, and since
the functions no longer should free the context itself, only
allocated elements within it, the previous naming was slightly
misleading.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-24 23:07:50 +02:00
Martin Storsjö 199fb40278 rtpdec: Use ffio_free_dyn_buf
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-24 23:07:44 +02:00
Martin Storsjö bb4a310bb8 rtpdec: Don't free the payload context in the .free function
This makes it more consistent with depacketizers that don't have any
.free function at all, where the payload context is freed by the
surrounding framework. Always free the context in the surrounding
framework, having the individual depacketizers only free any data
they've specifically allocated themselves.

This is similar to how this works for demuxer/muxers/codecs - a
component shouldn't free the priv_data that the framework has
allocated for it.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-24 23:07:35 +02:00
Martin Storsjö 88434f9725 rtpdec: Remove unnecessary inline attributes
These functions are far from performance critical, so there's no
point in marking them as inline.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-24 23:07:25 +02:00
Martin Storsjö 5d8cae4573 rtpdec: Get rid of all trivial .alloc/.free functions
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-24 16:24:19 +02:00
Martin Storsjö 2b982e92f4 rtpdec: Set need_parsing via a handler field
This avoids implementing a full function just to set this one
field.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-24 16:22:41 +02:00
Martin Storsjö b651c9139e rtpdec_mpa_robust: Move .enc_name to the start of the struct
This makes it match the other depacketizers.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-24 16:22:04 +02:00
Michael Niedermayer 1186e7cf95 Merge commit '96084251e57d1738fde02a2b0d37ca609d9efd71'
* commit '96084251e57d1738fde02a2b0d37ca609d9efd71':
  libavformat: add robust MPEG audio depacketization (RFC 5219)

Conflicts:
	Changelog
	libavformat/version.h

See: 22470510d1
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-22 01:30:17 +01:00
Gilles Chanteperdrix 96084251e5 libavformat: add robust MPEG audio depacketization (RFC 5219)
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-21 23:37:50 +02:00