lavc/bsf: move IS_EMPTY() to packet_internal()
It will be useful in other places.
This commit is contained in:
parent
c4332dfda9
commit
0f957cfba2
@ -31,8 +31,7 @@
|
|||||||
#include "bsf_internal.h"
|
#include "bsf_internal.h"
|
||||||
#include "codec_desc.h"
|
#include "codec_desc.h"
|
||||||
#include "codec_par.h"
|
#include "codec_par.h"
|
||||||
|
#include "packet_internal.h"
|
||||||
#define IS_EMPTY(pkt) (!(pkt)->data && !(pkt)->side_data_elems)
|
|
||||||
|
|
||||||
static av_always_inline const FFBitStreamFilter *ff_bsf(const AVBitStreamFilter *bsf)
|
static av_always_inline const FFBitStreamFilter *ff_bsf(const AVBitStreamFilter *bsf)
|
||||||
{
|
{
|
||||||
@ -205,7 +204,7 @@ int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt)
|
|||||||
FFBSFContext *const bsfi = ffbsfcontext(ctx);
|
FFBSFContext *const bsfi = ffbsfcontext(ctx);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!pkt || IS_EMPTY(pkt)) {
|
if (!pkt || AVPACKET_IS_EMPTY(pkt)) {
|
||||||
if (pkt)
|
if (pkt)
|
||||||
av_packet_unref(pkt);
|
av_packet_unref(pkt);
|
||||||
bsfi->eof = 1;
|
bsfi->eof = 1;
|
||||||
@ -217,7 +216,7 @@ int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt)
|
|||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IS_EMPTY(bsfi->buffer_pkt))
|
if (!AVPACKET_IS_EMPTY(bsfi->buffer_pkt))
|
||||||
return AVERROR(EAGAIN);
|
return AVERROR(EAGAIN);
|
||||||
|
|
||||||
ret = av_packet_make_refcounted(pkt);
|
ret = av_packet_make_refcounted(pkt);
|
||||||
@ -241,7 +240,7 @@ int ff_bsf_get_packet(AVBSFContext *ctx, AVPacket **pkt)
|
|||||||
if (bsfi->eof)
|
if (bsfi->eof)
|
||||||
return AVERROR_EOF;
|
return AVERROR_EOF;
|
||||||
|
|
||||||
if (IS_EMPTY(bsfi->buffer_pkt))
|
if (AVPACKET_IS_EMPTY(bsfi->buffer_pkt))
|
||||||
return AVERROR(EAGAIN);
|
return AVERROR(EAGAIN);
|
||||||
|
|
||||||
tmp_pkt = av_packet_alloc();
|
tmp_pkt = av_packet_alloc();
|
||||||
@ -261,7 +260,7 @@ int ff_bsf_get_packet_ref(AVBSFContext *ctx, AVPacket *pkt)
|
|||||||
if (bsfi->eof)
|
if (bsfi->eof)
|
||||||
return AVERROR_EOF;
|
return AVERROR_EOF;
|
||||||
|
|
||||||
if (IS_EMPTY(bsfi->buffer_pkt))
|
if (AVPACKET_IS_EMPTY(bsfi->buffer_pkt))
|
||||||
return AVERROR(EAGAIN);
|
return AVERROR(EAGAIN);
|
||||||
|
|
||||||
av_packet_move_ref(pkt, bsfi->buffer_pkt);
|
av_packet_move_ref(pkt, bsfi->buffer_pkt);
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
|
|
||||||
#include "packet.h"
|
#include "packet.h"
|
||||||
|
|
||||||
|
#define AVPACKET_IS_EMPTY(pkt) (!(pkt)->data && !(pkt)->side_data_elems)
|
||||||
|
|
||||||
typedef struct PacketListEntry {
|
typedef struct PacketListEntry {
|
||||||
struct PacketListEntry *next;
|
struct PacketListEntry *next;
|
||||||
AVPacket pkt;
|
AVPacket pkt;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user