It will be useful in other places.
Showing the changes to libavcodec (2 of 2 files). Show all
Unified · Split
| @@ -31,8 +31,7 @@ · 30 unmodified lines | ||
| 31 | 31 | #include "bsf_internal.h" |
| 32 | 32 | #include "codec_desc.h" |
| 33 | 33 | #include "codec_par.h" |
| 34 | − | |
| 35 | −#define IS_EMPTY(pkt) (!(pkt)->data && !(pkt)->side_data_elems) | |
| 34 | +#include "packet_internal.h" | |
| 36 | 35 | |
| 37 | 36 | static av_always_inline const FFBitStreamFilter *ff_bsf(const AVBitStreamFilter *bsf) |
| 38 | 37 | { |
| @@ -205,7 +204,7 @@ int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt) · 166 unmodified lines | ||
| 205 | 204 | FFBSFContext *const bsfi = ffbsfcontext(ctx); |
| 206 | 205 | int ret; |
| 207 | 206 | |
| 208 | − if (!pkt || IS_EMPTY(pkt)) { | |
| 207 | + if (!pkt || AVPACKET_IS_EMPTY(pkt)) { | |
| 209 | 208 | if (pkt) |
| 210 | 209 | av_packet_unref(pkt); |
| 211 | 210 | bsfi->eof = 1; |
| @@ -217,7 +216,7 @@ int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt) · 5 unmodified lines | ||
| 217 | 216 | return AVERROR(EINVAL); |
| 218 | 217 | } |
| 219 | 218 | |
| 220 | − if (!IS_EMPTY(bsfi->buffer_pkt)) | |
| 219 | + if (!AVPACKET_IS_EMPTY(bsfi->buffer_pkt)) | |
| 221 | 220 | return AVERROR(EAGAIN); |
| 222 | 221 | |
| 223 | 222 | ret = av_packet_make_refcounted(pkt); |
| @@ -241,7 +240,7 @@ int ff_bsf_get_packet(AVBSFContext *ctx, AVPacket **pkt) · 17 unmodified lines | ||
| 241 | 240 | if (bsfi->eof) |
| 242 | 241 | return AVERROR_EOF; |
| 243 | 242 | |
| 244 | − if (IS_EMPTY(bsfi->buffer_pkt)) | |
| 243 | + if (AVPACKET_IS_EMPTY(bsfi->buffer_pkt)) | |
| 245 | 244 | return AVERROR(EAGAIN); |
| 246 | 245 | |
| 247 | 246 | tmp_pkt = av_packet_alloc(); |
| @@ -261,7 +260,7 @@ int ff_bsf_get_packet_ref(AVBSFContext *ctx, AVPacket *pkt) · 13 unmodified lines | ||
| 261 | 260 | if (bsfi->eof) |
| 262 | 261 | return AVERROR_EOF; |
| 263 | 262 | |
| 264 | − if (IS_EMPTY(bsfi->buffer_pkt)) | |
| 263 | + if (AVPACKET_IS_EMPTY(bsfi->buffer_pkt)) | |
| 265 | 264 | return AVERROR(EAGAIN); |
| 266 | 265 | |
| 267 | 266 | av_packet_move_ref(pkt, bsfi->buffer_pkt); |
| @@ -23,6 +23,8 @@ · 22 unmodified lines | ||
| 23 | 23 | |
| 24 | 24 | #include "packet.h" |
| 25 | 25 | |
| 26 | +#define AVPACKET_IS_EMPTY(pkt) (!(pkt)->data && !(pkt)->side_data_elems) | |
| 27 | + | |
| 26 | 28 | typedef struct PacketListEntry { |
| 27 | 29 | struct PacketListEntry *next; |
| 28 | 30 | AVPacket pkt; |