Quoting James Almer (2024-08-31 18:31:14) > static int demux_send(Demuxer *d, DemuxThreadContext *dt, DemuxStream *ds, > AVPacket *pkt, unsigned flags) > { > InputFile *f = &d->f; > - int ret; > + int ret = 0; > > // pkt can be NULL only when flushing BSFs > av_assert0(ds->bsf || pkt); > > + // a stream can only be disabled if it's needed by a group
This makes no sense to me. > + av_assert0(ds->nb_stream_groups || !ds->discard); > + > + // create a reference for the packet to be filtered by group bsfs What are "group bsfs"? > + if (pkt && ds->nb_stream_groups) { > + av_packet_unref(dt->pkt_group_bsf); > + ret = av_packet_ref(dt->pkt_group_bsf, pkt); > + if (ret < 0) > + return ret; > + } > + > // send heartbeat for sub2video streams > - if (d->pkt_heartbeat && pkt && pkt->pts != AV_NOPTS_VALUE) { > + if (d->pkt_heartbeat && pkt && !ds->discard && pkt->pts != > AV_NOPTS_VALUE) { Random added checks for ds->discard are extremely confusing and tell me you're overloading that poor field to mean something extremely non-obvious. > +static int istg_add(Demuxer *d, AVStreamGroup *stg) > +{ > + InputFile *f = &d->f; > + DemuxStreamGroup *dsg; > + const AVBitStreamFilter *filter; > + int base_idx = -1, enhancement_idx = -1; > + int ret; > + > + // TODO: generic handling of groups, once support for more is added > + if (stg->type != AV_STREAM_GROUP_PARAMS_LCEVC) > + return 0; I'd prefer this function to be essentially a switch that dispatches to per-type handlers. > + > + if (stg->nb_streams != 2) > + return AVERROR_BUG; > + > + filter = av_bsf_get_by_name("lcevc_merge"); > + if (!filter) > + return 0; > + > + dsg = demux_stream_group_alloc(d, stg); > + if (!dsg) > + return AVERROR(ENOMEM); > + > + dsg->discard = 1; > + > + // set the main stream for the group > + for (int i = 0; i < stg->nb_streams; i++) { > + int j; > + > + for (j = 0; j < f->nb_streams; j++) > + if (stg->streams[i] == f->streams[j]->st) > + break; > + > + if (j == f->nb_streams) > + return AVERROR_BUG; Isn't all this just "j = stg->streams[i]->index"? -- Anton Khirnov _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".