fftools/ffmpeg_dec: move InputStream.pkt to Decoder

It is purely internal to decoding.
This commit is contained in:
Anton Khirnov
2023-05-18 05:41:53 +02:00
parent dadeb28e25
commit 5b05e9e32a
3 changed files with 7 additions and 7 deletions

View File

@@ -33,6 +33,7 @@
struct Decoder {
AVFrame *frame;
AVPacket *pkt;
};
void dec_free(Decoder **pdec)
@@ -43,6 +44,7 @@ void dec_free(Decoder **pdec)
return;
av_frame_free(&dec->frame);
av_packet_free(&dec->pkt);
av_freep(pdec);
}
@@ -61,6 +63,10 @@ static int dec_alloc(Decoder **pdec)
if (!dec->frame)
goto fail;
dec->pkt = av_packet_alloc();
if (!dec->pkt)
goto fail;
*pdec = dec;
@@ -418,7 +424,7 @@ int dec_packet(InputStream *ist, const AVPacket *pkt, int no_eof)
int ret;
if (dec->codec_type == AVMEDIA_TYPE_SUBTITLE)
return transcode_subtitles(ist, pkt ? pkt : ist->pkt);
return transcode_subtitles(ist, pkt ? pkt : d->pkt);
// With fate-indeo3-2, we're getting 0-sized packets before EOF for some
// reason. This seems like a semi-critical bug. Don't trigger EOF, and