switch (avctx->codec_type) {
case AVMEDIA_TYPE_VIDEO: {
- AVPicture picture;
+ uint8_t *data[4];
+ int linesize[4];
int size[4] = { 0 };
int w = frame->width;
int h = frame->height;
do {
// NOTE: do not align linesizes individually, this breaks e.g. assumptions
// that linesize[0] == 2*linesize[1] in the MPEG-encoder for 4:2:2
- av_image_fill_linesizes(picture.linesize, avctx->pix_fmt, w);
+ av_image_fill_linesizes(linesize, avctx->pix_fmt, w);
// increase alignment of w for next try (rhs gives the lowest bit set in w)
w += w & ~(w - 1);
unaligned = 0;
for (i = 0; i < 4; i++)
- unaligned |= picture.linesize[i] % pool->stride_align[i];
+ unaligned |= linesize[i] % pool->stride_align[i];
} while (unaligned);
- tmpsize = av_image_fill_pointers(picture.data, avctx->pix_fmt, h,
- NULL, picture.linesize);
+ tmpsize = av_image_fill_pointers(data, avctx->pix_fmt, h,
+ NULL, linesize);
if (tmpsize < 0)
return -1;
- for (i = 0; i < 3 && picture.data[i + 1]; i++)
- size[i] = picture.data[i + 1] - picture.data[i];
- size[i] = tmpsize - (picture.data[i] - picture.data[0]);
+ for (i = 0; i < 3 && data[i + 1]; i++)
+ size[i] = data[i + 1] - data[i];
+ size[i] = tmpsize - (data[i] - data[0]);
for (i = 0; i < 4; i++) {
av_buffer_pool_uninit(&pool->pools[i]);
- pool->linesize[i] = picture.linesize[i];
+ pool->linesize[i] = linesize[i];
if (size[i]) {
pool->pools[i] = av_buffer_pool_init(size[i] + 16 + STRIDE_ALIGN - 1,
CONFIG_MEMORY_POISONING ?
AVHWAccel *hwa = find_hwaccel(avctx->codec_id, fmt);
int ret = 0;
+ if (avctx->active_thread_type & FF_THREAD_FRAME) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Hardware accelerated decoding with frame threading is not supported.\n");
+ return AVERROR(EINVAL);
+ }
+
if (!hwa) {
av_log(avctx, AV_LOG_ERROR,
"Could not find an AVHWAccel for the pixel format: %s",
*got_packet_ptr = 0;
if (!(avctx->codec->capabilities & AV_CODEC_CAP_DELAY) && !frame) {
- av_free_packet(avpkt);
+ av_packet_unref(avpkt);
av_init_packet(avpkt);
return 0;
}
}
if (ret < 0 || !*got_packet_ptr) {
- av_free_packet(avpkt);
+ av_packet_unref(avpkt);
av_init_packet(avpkt);
goto end;
}
avctx->stats_out[0] = '\0';
if (!(avctx->codec->capabilities & AV_CODEC_CAP_DELAY) && !frame) {
- av_free_packet(avpkt);
+ av_packet_unref(avpkt);
av_init_packet(avpkt);
avpkt->size = 0;
return 0;
}
if (ret < 0 || !*got_packet_ptr)
- av_free_packet(avpkt);
+ av_packet_unref(avpkt);
emms_c();
return ret;
ret = FFMIN(AVERROR(errno), -1);
av_log(avctx, AV_LOG_ERROR, "Unable to recode subtitle event \"%s\" "
"from %s to UTF-8\n", inpkt->data, avctx->sub_charenc);
- av_free_packet(&tmp);
+ av_packet_unref(&tmp);
goto end;
}
outpkt->size -= outl;
pkt_recoded.side_data = NULL;
pkt_recoded.side_data_elems = 0;
- av_free_packet(&pkt_recoded);
+ av_packet_unref(&pkt_recoded);
}
if (avctx->codec_descriptor->props & AV_CODEC_PROP_BITMAP_SUB)
sub->format = 0;
int i;
for (i = 0; i < sub->num_rects; i++) {
- av_freep(&sub->rects[i]->pict.data[0]);
- av_freep(&sub->rects[i]->pict.data[1]);
- av_freep(&sub->rects[i]->pict.data[2]);
- av_freep(&sub->rects[i]->pict.data[3]);
+ av_freep(&sub->rects[i]->data[0]);
+ av_freep(&sub->rects[i]->data[1]);
+ av_freep(&sub->rects[i]->data[2]);
+ av_freep(&sub->rects[i]->data[3]);
av_freep(&sub->rects[i]->text);
av_freep(&sub->rects[i]->ass);
av_freep(&sub->rects[i]);
case AV_CODEC_ID_ADPCM_IMA_WS:
case AV_CODEC_ID_ADPCM_G722:
case AV_CODEC_ID_ADPCM_YAMAHA:
+ case AV_CODEC_ID_ADPCM_AICA:
return 4;
case AV_CODEC_ID_DSD_LSBF:
case AV_CODEC_ID_DSD_MSBF:
case AV_CODEC_ID_PCM_S8_PLANAR:
case AV_CODEC_ID_PCM_U8:
case AV_CODEC_ID_PCM_ZORK:
+ case AV_CODEC_ID_SDX2_DPCM:
return 8;
case AV_CODEC_ID_PCM_S16BE:
case AV_CODEC_ID_PCM_S16BE_PLANAR:
return frame_bytes * 8 / bps;
}
- if (ch > 0) {
+ if (ch > 0 && ch < INT_MAX/16) {
/* calc from frame_bytes and channels */
switch (id) {
case AV_CODEC_ID_ADPCM_AFC: