[FFmpeg-devel] [PATCH v2] avformat/tee: Support arbitrary number of slaves
Marton Balint
cus at passwd.hu
Thu Jun 16 23:52:15 CEST 2016
On Thu, 16 Jun 2016, Jan Sebechlebsky wrote:
>> - char *slaves[MAX_SLAVES];
>> + char **slaves = NULL;
>> int ret;
>>
>> while (*filename) {
>> - if (nb_slaves == MAX_SLAVES) {
>> - av_log(avf, AV_LOG_ERROR, "Maximum %d slave muxers
> reached.\n",
>> - MAX_SLAVES);
>> - ret = AVERROR_PATCHWELCOME;
>> + char *slave = av_get_token(&filename, slave_delim);
>> + if (!slave) {
>> + ret = AVERROR(ENOMEM);
>> goto fail;
>> }
>> - if (!(slaves[nb_slaves++] = av_get_token(&filename, slave_delim)))
> {
>> + dynarray_add(&slaves, &nb_slaves, slave);
>> + if (!slaves) {
>> ret = AVERROR(ENOMEM);
How are you freeing individual slaves? Aren't those pointers get lost when
dynarray returns NULL?
Thanks,
Marton
More information about the ffmpeg-devel
mailing list