@@ -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:
Fixes invalid reports of bad lossless crc. Signed-off-by: Paul B Mahol <onemda@gmail.com> --- libavcodec/mlpdec.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)