mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-10-15 21:32:12 +08:00
avcodec/internal: Allow receive_frame codecs to use decode_simple pkt
Decoders implementing the receive_frame API currently mostly use stack packets to temporarily hold the packet they receive from ff_decode_get_packet(). This role directly parallels the role of in_pkt, the spare packet used in decode_simple_internal for the decoders implementing the traditional decoding API. Said packet is unused by the generic code for the decoders implementing the receive_frame API, so allow them to use it to fulfill the function it already fulfills for the traditional API for both APIs. There is only one caveat in this: The packet is automatically unreferenced in avcodec_flush_buffers(). But this is actually positive as it means the decoders don't have to do this themselves (in case the packet is preserved between receive_frame calls). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -296,8 +296,7 @@ static int64_t guess_correct_pts(AVCodecContext *ctx,
|
||||
static inline int decode_simple_internal(AVCodecContext *avctx, AVFrame *frame, int64_t *discarded_samples)
|
||||
{
|
||||
AVCodecInternal *avci = avctx->internal;
|
||||
DecodeSimpleContext *ds = &avci->ds;
|
||||
AVPacket *pkt = ds->in_pkt;
|
||||
AVPacket *const pkt = avci->in_pkt;
|
||||
int got_frame, actual_got_frame;
|
||||
int ret;
|
||||
|
||||
|
Reference in New Issue
Block a user