You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avformat/evcdec: flush the bsf on EOF
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
@@ -183,15 +183,14 @@ static int evc_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
int ret;
|
int ret;
|
||||||
int32_t nalu_size;
|
int32_t nalu_size;
|
||||||
int au_end_found = 0;
|
int au_end_found = 0;
|
||||||
|
|
||||||
EVCDemuxContext *const c = s->priv_data;
|
EVCDemuxContext *const c = s->priv_data;
|
||||||
|
|
||||||
if (avio_feof(s->pb))
|
|
||||||
return AVERROR_EOF;
|
|
||||||
|
|
||||||
while(!au_end_found) {
|
while(!au_end_found) {
|
||||||
uint8_t buf[EVC_NALU_LENGTH_PREFIX_SIZE];
|
uint8_t buf[EVC_NALU_LENGTH_PREFIX_SIZE];
|
||||||
|
|
||||||
|
if (avio_feof(s->pb))
|
||||||
|
goto end;
|
||||||
|
|
||||||
ret = ffio_ensure_seekback(s->pb, EVC_NALU_LENGTH_PREFIX_SIZE);
|
ret = ffio_ensure_seekback(s->pb, EVC_NALU_LENGTH_PREFIX_SIZE);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
@@ -212,6 +211,7 @@ static int evc_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
if (ret != (nalu_size + EVC_NALU_LENGTH_PREFIX_SIZE))
|
if (ret != (nalu_size + EVC_NALU_LENGTH_PREFIX_SIZE))
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
|
end:
|
||||||
ret = av_bsf_send_packet(c->bsf, pkt);
|
ret = av_bsf_send_packet(c->bsf, pkt);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
av_log(s, AV_LOG_ERROR, "Failed to send packet to "
|
av_log(s, AV_LOG_ERROR, "Failed to send packet to "
|
||||||
|
Reference in New Issue
Block a user