History

lavc/bsf: move IS_EMPTY() to packet_internal()

It will be useful in other places.

Anton Khirnov committed 3 years ago

Commit 0f957cf1 parent c4332df2 files · +7 −6Browse files

Unified · Split

2 files
  1. libavcodec/bsf.c +5 −6
  2. libavcodec/packet_internal.h +2 −0
libavcodec/bsf.c+5−6
@@ -31,8 +31,7 @@ · 30 unmodified lines
3131 #include "bsf_internal.h"
3232 #include "codec_desc.h"
3333 #include "codec_par.h"
34−
35−#define IS_EMPTY(pkt) (!(pkt)->data && !(pkt)->side_data_elems)
34+#include "packet_internal.h"
3635
3736 static av_always_inline const FFBitStreamFilter *ff_bsf(const AVBitStreamFilter *bsf)
3837 {
@@ -205,7 +204,7 @@ int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt) · 166 unmodified lines
205204 FFBSFContext *const bsfi = ffbsfcontext(ctx);
206205 int ret;
207206
208− if (!pkt || IS_EMPTY(pkt)) {
207+ if (!pkt || AVPACKET_IS_EMPTY(pkt)) {
209208 if (pkt)
210209 av_packet_unref(pkt);
211210 bsfi->eof = 1;
@@ -217,7 +216,7 @@ int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt) · 5 unmodified lines
217216 return AVERROR(EINVAL);
218217 }
219218
220− if (!IS_EMPTY(bsfi->buffer_pkt))
219+ if (!AVPACKET_IS_EMPTY(bsfi->buffer_pkt))
221220 return AVERROR(EAGAIN);
222221
223222 ret = av_packet_make_refcounted(pkt);
@@ -241,7 +240,7 @@ int ff_bsf_get_packet(AVBSFContext *ctx, AVPacket **pkt) · 17 unmodified lines
241240 if (bsfi->eof)
242241 return AVERROR_EOF;
243242
244− if (IS_EMPTY(bsfi->buffer_pkt))
243+ if (AVPACKET_IS_EMPTY(bsfi->buffer_pkt))
245244 return AVERROR(EAGAIN);
246245
247246 tmp_pkt = av_packet_alloc();
@@ -261,7 +260,7 @@ int ff_bsf_get_packet_ref(AVBSFContext *ctx, AVPacket *pkt) · 13 unmodified lines
261260 if (bsfi->eof)
262261 return AVERROR_EOF;
263262
264− if (IS_EMPTY(bsfi->buffer_pkt))
263+ if (AVPACKET_IS_EMPTY(bsfi->buffer_pkt))
265264 return AVERROR(EAGAIN);
266265
267266 av_packet_move_ref(pkt, bsfi->buffer_pkt);
libavcodec/packet_internal.h+2−0
@@ -23,6 +23,8 @@ · 22 unmodified lines
2323
2424 #include "packet.h"
2525
26+#define AVPACKET_IS_EMPTY(pkt) (!(pkt)->data && !(pkt)->side_data_elems)
27+
2628 typedef struct PacketListEntry {
2729 struct PacketListEntry *next;
2830 AVPacket pkt;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t