Fixes invalid reports of bad lossless crc. Signed-off-by: Paul B Mahol <one...@gmail.com> --- libavcodec/mlpdec.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c index e4992550ee..f0012cbb05 100644 --- a/libavcodec/mlpdec.c +++ b/libavcodec/mlpdec.c @@ -1142,6 +1142,7 @@ static int read_access_unit(AVCodecContext *avctx, void* data, unsigned int substream_start; unsigned int header_size = 4; unsigned int substr_header_size = 0; + unsigned int end_of_stream = 0; uint8_t substream_parity_present[MAX_SUBSTREAMS]; uint16_t substream_data_len[MAX_SUBSTREAMS]; uint8_t parity_bits; @@ -1286,8 +1287,10 @@ static int read_access_unit(AVCodecContext *avctx, void* data, else if (m->avctx->codec_id == AV_CODEC_ID_MLP && shorten_by != 0xD234) return AVERROR_INVALIDDATA; - if (substr == m->max_decoded_substream) + if (substr == m->max_decoded_substream) { av_log(m->avctx, AV_LOG_INFO, "End of stream indicated.\n"); + end_of_stream = 1; + } } if (substream_parity_present[substr]) { @@ -1319,6 +1322,9 @@ next_substr: if ((ret = output_data(m, m->max_decoded_substream, data, got_frame_ptr)) < 0) return ret; + if (end_of_stream) + m->substream[m->max_decoded_substream].lossless_check_data = 0xffffffff; + return length; substream_length_mismatch: -- 2.17.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".