void mpeg2_set_buf (mpeg2dec_t * mpeg2dec, uint8_t * buf[3], void * id) { mpeg2_fbuf_t * fbuf; if (mpeg2dec->custom_fbuf) { if (mpeg2dec->state == STATE_SEQUENCE) { mpeg2dec->fbuf[2] = mpeg2dec->fbuf[1]; mpeg2dec->fbuf[1] = mpeg2dec->fbuf[0]; } mpeg2_set_fbuf (mpeg2dec, (mpeg2dec->decoder.coding_type == PIC_FLAG_CODING_TYPE_B)); fbuf = mpeg2dec->fbuf[0]; } else { fbuf = &(mpeg2dec->fbuf_alloc[mpeg2dec->alloc_index].fbuf); mpeg2dec->alloc_index_user = ++mpeg2dec->alloc_index; } fbuf->buf[0] = buf[0]; fbuf->buf[1] = buf[1]; fbuf->buf[2] = buf[2]; fbuf->id = id; // HACK! FIXME! At first I frame, copy pointers to prediction frame too! if (mpeg2dec->custom_fbuf && !mpeg2dec->fbuf[1]->buf[0]) { mpeg2dec->fbuf[1]->buf[0] = buf[0]; mpeg2dec->fbuf[1]->buf[1] = buf[1]; mpeg2dec->fbuf[1]->buf[2] = buf[2]; mpeg2dec->fbuf[1]->id = NULL; } }
void mpeg2_set_buf (mpeg2dec_t * mpeg2dec, uint8_t * buf[3], void * id) { mpeg2_fbuf_t * fbuf; if (mpeg2dec->custom_fbuf) { if (mpeg2dec->state == STATE_SEQUENCE) { mpeg2dec->fbuf[2] = mpeg2dec->fbuf[1]; mpeg2dec->fbuf[1] = mpeg2dec->fbuf[0]; } mpeg2_set_fbuf (mpeg2dec, (mpeg2dec->decoder.coding_type == PIC_FLAG_CODING_TYPE_B)); fbuf = mpeg2dec->fbuf[0]; } else { fbuf = &(mpeg2dec->fbuf_alloc[mpeg2dec->alloc_index].fbuf); mpeg2dec->alloc_index_user = ++mpeg2dec->alloc_index; } fbuf->buf[0] = buf[0]; fbuf->buf[1] = buf[1]; fbuf->buf[2] = buf[2]; fbuf->id = id; }