struct VpxInputContext *vpx_ctx) {
mkvparser::MkvReader *const reader = new mkvparser::MkvReader(vpx_ctx->file);
webm_ctx->reader = reader;
+ webm_ctx->reached_eos = 0;
mkvparser::EBMLHeader header;
long long pos = 0;
uint8_t **buffer,
size_t *bytes_in_buffer,
size_t *buffer_size) {
+ // This check is needed for frame parallel decoding, in which case this
+ // function could be called even after it has reached end of input stream.
+ if (webm_ctx->reached_eos) {
+ return 1;
+ }
mkvparser::Segment *const segment =
reinterpret_cast<mkvparser::Segment*>(webm_ctx->segment);
const mkvparser::Cluster* cluster =
cluster = segment->GetNext(cluster);
if (cluster == NULL || cluster->EOS()) {
*bytes_in_buffer = 0;
+ webm_ctx->reached_eos = 1;
return 1;
}
status = cluster->GetFirst(block_entry);