/* for each open output create a corresponding stream */
for (i = 0, inout = output_links; inout; i++, inout = inout->next) {
AVStream *st;
- if (!(st = av_new_stream(avctx, i)))
+ if (!(st = avformat_new_stream(avctx, NULL)))
FAIL(AVERROR(ENOMEM));
+ st->id = i;
}
/* create a sink for each output and connect them to the graph */
avpicture_layout(&pict, ref->format, ref->video->w,
ref->video->h, pkt->data, size);
} else if (ref->audio) {
- size = ref->linesize[0];
+ size = ref->audio->nb_samples *
+ av_get_bytes_per_sample(ref->format) *
+ av_get_channel_layout_nb_channels(ref->audio->channel_layout);
if ((ret = av_new_packet(pkt, size)) < 0)
return ret;
memcpy(pkt->data, ref->data[0], size);
#define DEC AV_OPT_FLAG_DECODING_PARAM
static const AVOption options[] = {
- { "graph", "Libavfilter graph", OFFSET(graph_str), FF_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC },
+ { "graph", "Libavfilter graph", OFFSET(graph_str), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC },
{ NULL },
};